diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 9735f6812b..b8c206b059 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -15,6 +15,64 @@ # specific language governing permissions and limitations # under the License. +set(SERVER_COMMON_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/server_utils.cpp) + +set(COLLECTOR_SRC + ${SERVER_COMMON_SRC} + ${CMAKE_CURRENT_SOURCE_DIR}/available_detector.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/info_collector.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/info_collector_app.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hotspot_partition_calculator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/result_writer.cpp) + +set(META_SERVER_SRC + ${SERVER_COMMON_SRC}) + +set(REPLICA_SERVER_SRC + ${SERVER_COMMON_SRC} + ${CMAKE_CURRENT_SOURCE_DIR}/capacity_unit_calculator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/compaction_filter_rule.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/compaction_operation.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hotkey_collector.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_event_listener.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_manual_compact_service.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_mutation_duplicator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_server_impl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_server_impl_init.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_server_write.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pegasus_write_service.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb_wrapper.cpp) + +set(SERVER_COMMON_LIBS + dsn_utils) +set(COLLECTOR_LIBS + ${SERVER_COMMON_LIBS} + dsn_meta_server + pegasus_client_static + event) +set(META_SERVER_LIBS + ${SERVER_COMMON_LIBS} + dsn_meta_server + dsn.failure_detector + dsn.replication.zookeeper_provider + dsn.block_service + event + zookeeper + hashtable) +set(REPLICA_SERVER_LIBS + ${SERVER_COMMON_LIBS} + dsn_replica_server + dsn_replication_common + dsn_client + dsn.block_service.local + dsn.block_service + dsn.failure_detector + rocksdb + pegasus_base + pegasus_client_static + event) + if (SEPARATE_SERVERS) add_subdirectory(collector) add_subdirectory(meta_server) @@ -26,7 +84,6 @@ else () set(MY_PROJ_LIBS dsn_replica_server dsn_meta_server - dsn_ranger dsn_replication_common dsn_client dsn.block_service.local @@ -35,16 +92,12 @@ else () dsn.replication.zookeeper_provider dsn_utils rocksdb - lz4 - zstd - snappy pegasus_base pegasus_client_static event hashtable) set(MY_BOOST_LIBS Boost::system Boost::filesystem) - set(MY_BINPLACES - config.ini) + set(MY_BINPLACES config.ini) SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) dsn_add_executable() diff --git a/src/server/collector/CMakeLists.txt b/src/server/collector/CMakeLists.txt index 0fd772be21..bbbf2294d6 100644 --- a/src/server/collector/CMakeLists.txt +++ b/src/server/collector/CMakeLists.txt @@ -17,29 +17,11 @@ set(MY_PROJ_NAME "pegasus_collector") -set(MY_PROJ_SRC - "${CMAKE_CURRENT_SOURCE_DIR}/../available_detector.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../info_collector.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../info_collector_app.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../server_utils.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../result_writer.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../hotspot_partition_calculator.cpp") - +set(MY_PROJ_SRC ${COLLECTOR_SRC}) set(MY_SRC_SEARCH_MODE "GLOB") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") - -set(MY_PROJ_LIBS - dsn_meta_server - dsn.failure_detector - dsn_utils - dsn.block_service - pegasus_base - pegasus_client_static - event) - +set(MY_PROJ_LIBS ${COLLECTOR_LIBS}) set(MY_BOOST_LIBS Boost::system Boost::filesystem) - SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/src/server/meta_server/CMakeLists.txt b/src/server/meta_server/CMakeLists.txt index 327d9fa3c9..51ec44ca6a 100644 --- a/src/server/meta_server/CMakeLists.txt +++ b/src/server/meta_server/CMakeLists.txt @@ -17,26 +17,11 @@ set(MY_PROJ_NAME "pegasus_meta_server") -set(MY_PROJ_SRC - "${CMAKE_CURRENT_SOURCE_DIR}/../server_utils.cpp") - +set(MY_PROJ_SRC ${META_SERVER_SRC}) set(MY_SRC_SEARCH_MODE "GLOB") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") - -set(MY_PROJ_LIBS - dsn_meta_server - dsn.failure_detector - dsn.replication.zookeeper_provider - dsn_utils - dsn.block_service - pegasus_base - event - zookeeper - hashtable) - +set(MY_PROJ_LIBS ${META_SERVER_LIBS}) set(MY_BOOST_LIBS Boost::system Boost::filesystem) - SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/src/server/replica_server/CMakeLists.txt b/src/server/replica_server/CMakeLists.txt index 4765c44996..52e1b13f49 100644 --- a/src/server/replica_server/CMakeLists.txt +++ b/src/server/replica_server/CMakeLists.txt @@ -17,38 +17,11 @@ set(MY_PROJ_NAME "pegasus_replica_server") -set(TEMP_SRC "") -file("GLOB" TEMP_SRC - "${CMAKE_CURRENT_SOURCE_DIR}/../*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../*.c") -set(MY_PROJ_SRC ${TEMP_SRC}) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../available_detector.cpp) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../info_collector.cpp) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../info_collector_app.cpp) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../result_writer.cpp) -list(REMOVE_ITEM MY_PROJ_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../hotspot_partition_calculator.cpp) - +set(MY_PROJ_SRC ${REPLICA_SERVER_SRC}) set(MY_SRC_SEARCH_MODE "GLOB") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") - -set(MY_PROJ_LIBS - dsn_replica_server - dsn_meta_server - dsn_replication_common - dsn_client - dsn.block_service.local - dsn.block_service - dsn.failure_detector - dsn_utils - rocksdb - pegasus_base - pegasus_client_static - event) - +set(MY_PROJ_LIBS ${REPLICA_SERVER_LIBS}) set(MY_BOOST_LIBS Boost::system Boost::filesystem) - SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)