foundationdb/fdbserver/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
2.1 KiB
CMake
Raw Normal View History

fdb_find_sources(FDBSERVER_SRCS)
2018-05-04 06:48:10 +08:00
if(${COROUTINE_IMPL} STREQUAL libcoro)
list(APPEND FDBSERVER_SRCS coroimpl/CoroFlowCoro.actor.cpp)
else()
list(APPEND FDBSERVER_SRCS coroimpl/CoroFlow.actor.cpp)
endif()
2020-06-11 05:07:49 +08:00
if (WITH_ROCKSDB_EXPERIMENTAL)
2020-06-04 04:32:39 +08:00
add_definitions(-DSSD_ROCKSDB_EXPERIMENTAL)
2020-06-06 06:58:45 +08:00
include(CompileRocksDB)
2020-10-07 02:22:03 +08:00
# CompileRocksDB sets `lz4_LIBRARIES` to be the shared lib, we want to link
# statically, so find the static library here.
find_library(lz4_STATIC_LIBRARIES
NAMES liblz4.a REQUIRED)
if(WITH_LIBURING)
find_package(uring)
endif()
2020-06-04 04:32:39 +08:00
endif()
2020-05-22 23:02:51 +08:00
2018-05-04 06:48:10 +08:00
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/workloads)
add_flow_target(EXECUTABLE NAME fdbserver SRCS ${FDBSERVER_SRCS})
2020-06-04 04:32:39 +08:00
2018-05-04 06:48:10 +08:00
target_include_directories(fdbserver PRIVATE
2019-06-06 04:24:06 +08:00
${CMAKE_SOURCE_DIR}/bindings/c
${CMAKE_BINARY_DIR}/bindings/c
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include)
2020-06-11 05:07:49 +08:00
if (WITH_ROCKSDB_EXPERIMENTAL)
2020-06-11 04:53:53 +08:00
add_dependencies(fdbserver rocksdb)
if(WITH_LIBURING)
target_include_directories(fdbserver PRIVATE ${ROCKSDB_INCLUDE_DIR} ${uring_INCLUDE_DIR})
target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${uring_LIBRARIES} ${lz4_STATIC_LIBRARIES})
target_compile_definitions(fdbserver PRIVATE BOOST_ASIO_HAS_IO_URING=1 BOOST_ASIO_DISABLE_EPOLL=1)
else()
target_include_directories(fdbserver PRIVATE ${ROCKSDB_INCLUDE_DIR})
target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${lz4_STATIC_LIBRARIES})
target_compile_definitions(fdbserver PRIVATE)
endif()
2020-06-04 04:32:39 +08:00
else()
target_link_libraries(fdbserver PRIVATE fdbclient sqlite)
2020-06-04 04:32:39 +08:00
endif()
target_link_libraries(fdbserver PRIVATE toml11_target jemalloc rapidjson)
# target_compile_definitions(fdbserver PRIVATE -DENABLE_SAMPLING)
if(GPERFTOOLS_FOUND)
target_link_libraries(fdbserver PRIVATE gperftools)
endif()
2018-05-04 06:48:10 +08:00
if(NOT OPEN_FOR_IDE)
if(GENERATE_DEBUG_PACKAGES)
fdb_install(TARGETS fdbserver DESTINATION sbin COMPONENT server)
else()
add_custom_target(prepare_fdbserver_install ALL DEPENDS strip_only_fdbserver)
fdb_install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/bin/fdbserver DESTINATION sbin COMPONENT server)
endif()
endif()