2022-06-28 08:54:58 +08:00
|
|
|
fdb_find_sources(FDBSERVER_SRCS)
|
2018-05-04 06:48:10 +08:00
|
|
|
|
2021-11-25 04:12:22 +08:00
|
|
|
if(${COROUTINE_IMPL} STREQUAL libcoro)
|
2022-06-28 08:54:58 +08:00
|
|
|
list(APPEND FDBSERVER_SRCS coroimpl/CoroFlowCoro.actor.cpp)
|
2021-02-18 00:23:41 +08:00
|
|
|
else()
|
2022-06-28 08:54:58 +08:00
|
|
|
list(APPEND FDBSERVER_SRCS coroimpl/CoroFlow.actor.cpp)
|
2021-02-18 00:23:41 +08:00
|
|
|
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
|
|
|
|
2020-06-09 00:22:28 +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)
|
2022-06-23 06:49:44 +08:00
|
|
|
if(WITH_LIBURING)
|
2022-01-28 02:54:54 +08:00
|
|
|
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)
|
|
|
|
|
2019-02-09 08:51:13 +08:00
|
|
|
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
|
2019-06-08 05:57:56 +08:00
|
|
|
${CMAKE_BINARY_DIR}/bindings/c
|
2022-06-28 08:54:58 +08:00
|
|
|
${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)
|
2022-01-28 02:54:54 +08:00
|
|
|
if(WITH_LIBURING)
|
|
|
|
target_include_directories(fdbserver PRIVATE ${ROCKSDB_INCLUDE_DIR} ${uring_INCLUDE_DIR})
|
2022-06-28 08:54:58 +08:00
|
|
|
target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${uring_LIBRARIES} ${lz4_STATIC_LIBRARIES})
|
2022-01-28 02:54:54 +08:00
|
|
|
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})
|
2022-06-28 08:54:58 +08:00
|
|
|
target_link_libraries(fdbserver PRIVATE fdbclient sqlite ${ROCKSDB_LIBRARIES} ${lz4_STATIC_LIBRARIES})
|
2022-01-28 02:54:54 +08:00
|
|
|
target_compile_definitions(fdbserver PRIVATE)
|
|
|
|
endif()
|
2020-06-04 04:32:39 +08:00
|
|
|
else()
|
2022-06-28 08:54:58 +08:00
|
|
|
target_link_libraries(fdbserver PRIVATE fdbclient sqlite)
|
2020-06-04 04:32:39 +08:00
|
|
|
endif()
|
|
|
|
|
2022-06-02 19:22:50 +08:00
|
|
|
target_link_libraries(fdbserver PRIVATE toml11_target jemalloc rapidjson)
|
2021-07-31 01:21:07 +08:00
|
|
|
# target_compile_definitions(fdbserver PRIVATE -DENABLE_SAMPLING)
|
2020-07-06 07:18:08 +08:00
|
|
|
|
2022-06-23 06:49:44 +08:00
|
|
|
if(GPERFTOOLS_FOUND)
|
2019-04-03 08:34:29 +08:00
|
|
|
target_link_libraries(fdbserver PRIVATE gperftools)
|
|
|
|
endif()
|
2018-05-04 06:48:10 +08:00
|
|
|
|
2021-01-26 08:09:32 +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()
|
2020-05-22 04:39:55 +08:00
|
|
|
endif()
|