From 900f6efd3001e8d22c2cae55470599060e87805f Mon Sep 17 00:00:00 2001 From: Brian Szmyd Date: Thu, 25 Jul 2024 12:19:26 -0600 Subject: [PATCH] Provide a single library per-component. (#93) Too many circular dependencies to care about. --- conanfile.py | 4 ++-- src/flatb/CMakeLists.txt | 1 + src/lib/CMakeLists.txt | 6 +++--- src/proto/CMakeLists.txt | 1 + src/tests/CMakeLists.txt | 5 ++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/conanfile.py b/conanfile.py index faca43c..1ff9721 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,7 +10,7 @@ class NuRaftMesgConan(ConanFile): name = "nuraft_mesg" - version = "3.5.5" + version = "3.5.6" homepage = "https://github.com/eBay/nuraft_mesg" description = "A gRPC service for NuRAFT" @@ -109,7 +109,7 @@ def package(self): copy(self, "*.so*", self.build_folder, lib_dir, keep_path=False) def package_info(self): - self.cpp_info.components["proto"].libs = ["nuraft_mesg", "nuraft_mesg_proto"] + self.cpp_info.components["proto"].libs = ["nuraft_mesg_proto"] self.cpp_info.components["proto"].set_property("pkg_config_name", "libnuraft_mesg_proto") self.cpp_info.components["proto"].requires.extend([ "nuraft::nuraft", diff --git a/src/flatb/CMakeLists.txt b/src/flatb/CMakeLists.txt index 0265088..7a67a95 100644 --- a/src/flatb/CMakeLists.txt +++ b/src/flatb/CMakeLists.txt @@ -17,6 +17,7 @@ add_library(${PROJECT_NAME}_flatb) target_sources(${PROJECT_NAME}_flatb PRIVATE flatb_client.cpp $ + $ ) target_include_directories(${PROJECT_NAME}_flatb PRIVATE $ diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 48c1759..54869f0 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required(VERSION 3.11) -add_library(${PROJECT_NAME}) -target_sources(${PROJECT_NAME} PRIVATE +add_library(${PROJECT_NAME}-core OBJECT) +target_sources(${PROJECT_NAME}-core PRIVATE manager_impl.cpp factory.cpp repl_service_ctx.cpp service.cpp grpc_server.cpp ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME}-core sisl::sisl nuraft::nuraft ) diff --git a/src/proto/CMakeLists.txt b/src/proto/CMakeLists.txt index b538e61..7dbc0ea 100644 --- a/src/proto/CMakeLists.txt +++ b/src/proto/CMakeLists.txt @@ -29,6 +29,7 @@ target_sources(${PROJECT_NAME}_proto PRIVATE proto_service.cpp $ $ + $ ) target_link_libraries(${PROJECT_NAME}_proto sisl::sisl diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index e000d2b..a842d39 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -9,7 +9,8 @@ target_sources(test_fixture PRIVATE test_state_manager.cpp ) target_link_libraries(test_fixture - ${PROJECT_NAME} + sisl::sisl + nuraft::nuraft jungle::jungle GTest::gmock ) @@ -21,7 +22,6 @@ target_sources(raft_service_test PRIVATE $ ) target_link_libraries (raft_service_test - ${PROJECT_NAME} ${PROJECT_NAME}_proto jungle::jungle GTest::gmock @@ -36,7 +36,6 @@ target_sources(data_service_test PRIVATE $ ) target_link_libraries (data_service_test - ${PROJECT_NAME} ${PROJECT_NAME}_proto jungle::jungle GTest::gmock