1
0
Fork 0

Create a arangoserver lib which we link againts arangod and tests

This commit is contained in:
Andreas Streichardt 2017-03-03 15:31:43 +01:00
parent 6168e81b2e
commit fe512ed526
3 changed files with 28 additions and 11 deletions

View File

@ -71,11 +71,6 @@ if (DEBUG_SYNC_REPLICATION)
add_definitions("-DDEBUG_SYNC_REPLICATION=1")
endif ()
option(CATCH_TESTS ON "Compile catch C++ tests")
if (CATCH_TESTS)
add_subdirectory(tests)
endif()
# ------------------------------------------------------------------------------
# VERSION information
@ -771,7 +766,8 @@ add_definitions("-DARANGODB_BOOST_VERSION=\"1.62.0\"")
add_definitions("-DVELOCYPACK_XXHASH=1")
foreach (LINK_DIR ${LINK_DIRECTORIES})
set(V8_LINK_DIRECTORIES "${LINK_DIRECTORIES}" CACHE INTERNAL "" FORCE)
foreach (LINK_DIR ${V8_LINK_DIRECTORIES})
link_directories("${LINK_DIR}")
endforeach()
@ -979,3 +975,8 @@ add_custom_target(clean_autogenerated_files
)
message(STATUS "building for git revision: ${ARANGODB_BUILD_REPOSITORY}")
option(CATCH_TESTS ON "Compile catch C++ tests")
if (CATCH_TESTS)
add_subdirectory(tests)
endif()

View File

@ -291,7 +291,6 @@ SET(ARANGOD_SOURCES
RestServer/UpgradeFeature.cpp
RestServer/VocbaseContext.cpp
RestServer/WorkMonitorFeature.cpp
RestServer/arangod.cpp
Scheduler/Acceptor.cpp
Scheduler/AcceptorTcp.cpp
Scheduler/Job.cpp
@ -367,13 +366,13 @@ if (NOT MSVC)
set(ARANGOD_SOURCES ${ARANGOD_SOURCES} Scheduler/AcceptorUnixDomain.cpp Scheduler/SocketUnixDomain.cpp)
endif()
add_executable(${BIN_ARANGOD} ${ARANGOD_SOURCES})
add_library(arangoserver STATIC ${ARANGOD_SOURCES})
if (USE_SSL)
target_compile_definitions(${BIN_ARANGOD} PUBLIC "ARANGODB_SSL_ENABLED=1")
endif()
target_link_libraries(${BIN_ARANGOD}
target_link_libraries(arangoserver
${LIB_ARANGO_FE}
${LIB_ARANGO_V8}
${LIB_ARANGO}
@ -386,6 +385,14 @@ target_link_libraries(${BIN_ARANGOD}
boost_system
)
add_executable(${BIN_ARANGOD}
RestServer/arangod.cpp
)
target_link_libraries(${BIN_ARANGOD}
arangoserver
)
install(
TARGETS ${BIN_ARANGOD}
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}

View File

@ -1,12 +1,21 @@
foreach (LINK_DIR ${V8_LINK_DIRECTORIES})
link_directories("${LINK_DIR}")
endforeach()
# linking is a dark art...workmonitordummy is somehow necessary
add_executable(
arangodb_catch_tests
../lib/Basics/WorkMonitorDummy.cpp
main.cpp
)
target_include_directories(arangodb_catch_tests PRIVATE
${CMAKE_SOURCE_DIR}/3rdParty/catch
target_link_libraries(
arangodb_catch_tests
arangoserver
)
target_include_directories(arangodb_catch_tests PRIVATE
${INCLUDE_DIRECTORIES}
${CMAKE_SOURCE_DIR}/3rdParty/catch
${CMAKE_SOURCE_DIR}/3rdParty/fakeit
)