This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch feature/579-automatic-dependency-deduction in repository https://gitbox.apache.org/repos/asf/celix.git
commit 46915e077327523c8453726b9ca0acada2b643e9 Author: PengZheng <[email protected]> AuthorDate: Thu Jul 13 09:31:29 2023 +0800 Add automatic dependency deduction to RSA. Fix indentation. --- .../remote_services/discovery_common/CMakeLists.txt | 1 + bundles/remote_services/examples/CMakeLists.txt | 5 ++++- .../remote_service_admin_dfi/gtest/CMakeLists.txt | 2 -- .../gtest/client.properties.in | 2 +- .../rsa_shm/gtest/CMakeLists.txt | 2 +- .../remote_services/topology_manager/CMakeLists.txt | 2 +- bundles/shell/shell_bonjour/CMakeLists.txt | 4 ++-- cmake/CelixDeps.cmake.in | 6 ++---- conanfile.py | 18 ++++++------------ libs/utils/CMakeLists.txt | 6 +++--- 10 files changed, 21 insertions(+), 27 deletions(-) diff --git a/bundles/remote_services/discovery_common/CMakeLists.txt b/bundles/remote_services/discovery_common/CMakeLists.txt index 8db7c886..aa94f2fb 100644 --- a/bundles/remote_services/discovery_common/CMakeLists.txt +++ b/bundles/remote_services/discovery_common/CMakeLists.txt @@ -31,6 +31,7 @@ if (RSA_DISCOVERY_COMMON) ) target_include_directories(rsa_discovery_common PUBLIC include PRIVATE src ${LIBXML2_INCLUDE_DIR}) + celix_target_hide_symbols(rsa_discovery_common) celix_deprecated_utils_headers(rsa_discovery_common) celix_deprecated_framework_headers(rsa_discovery_common) target_link_libraries(rsa_discovery_common diff --git a/bundles/remote_services/examples/CMakeLists.txt b/bundles/remote_services/examples/CMakeLists.txt index d2c8e517..65fea929 100644 --- a/bundles/remote_services/examples/CMakeLists.txt +++ b/bundles/remote_services/examples/CMakeLists.txt @@ -18,7 +18,10 @@ add_subdirectory(calculator_api) add_subdirectory(calculator_service) -add_subdirectory(calculator_shell) + +if (BUILD_SHELL) + add_subdirectory(calculator_shell) +endif () add_subdirectory(remote_example_api) add_subdirectory(remote_example_service) diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt index 4de2a276..4c194dc5 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt @@ -53,7 +53,6 @@ target_link_libraries(test_rsa_dfi PRIVATE get_property(rsa_bundle_file TARGET rsa_dfi PROPERTY BUNDLE_FILE) get_property(calc_bundle_file TARGET calculator PROPERTY BUNDLE_FILE) -get_property(calculator_shell_bundle_file TARGET calculator_shell PROPERTY BUNDLE_FILE) get_property(discovery_bundle_file TARGET rsa_discovery PROPERTY BUNDLE_FILE) get_property(topology_manager_bundle_file TARGET Celix::rsa_topology_manager PROPERTY BUNDLE_FILE) get_property(tst_bundle_file TARGET rsa_dfi_tst_bundle PROPERTY BUNDLE_FILE) @@ -69,7 +68,6 @@ add_celix_bundle_dependencies(test_rsa_dfi rsa_dfi #note depend on the target creating the bundle zip not the lib target calculator remote_example_service - calculator_shell rsa_discovery Celix::rsa_topology_manager rsa_dfi_tst_bundle diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in b/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in index 56411104..7c8ed7ee 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in +++ b/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in @@ -1,4 +1,4 @@ -cosgi.auto.start.1=@rsa_bundle_file@ @calculator_shell_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@ @tst_bundle_file@ +cosgi.auto.start.1=@rsa_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@ @tst_bundle_file@ LOGHELPER_ENABLE_STDOUT_FALLBACK=true org.osgi.framework.storage.clean=onFirstInit org.osgi.framework.storage=.cacheClient diff --git a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt index 26357f3f..030832ae 100644 --- a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt @@ -39,7 +39,7 @@ add_celix_bundle_dependencies(integration_test_rsa_shm Celix::rsa_shm) add_test(NAME run_integration_test_rsa_shm COMMAND integration_test_rsa_shm) setup_target_for_coverage(integration_test_rsa_shm SCAN_DIR ..) -if (LINKER_WRAP_SUPPORTED) +if (LINKER_WRAP_SUPPORTED AND BUILD_RSA_JSON_RPC) ####unit test add_executable(unit_test_rsa_shm src/RsaShmImplUnitTestSuite.cc diff --git a/bundles/remote_services/topology_manager/CMakeLists.txt b/bundles/remote_services/topology_manager/CMakeLists.txt index 8541c050..1ed7420b 100644 --- a/bundles/remote_services/topology_manager/CMakeLists.txt +++ b/bundles/remote_services/topology_manager/CMakeLists.txt @@ -35,7 +35,7 @@ install_celix_bundle(rsa_topology_manager EXPORT celix COMPONENT rsa) #Setup target aliases to match external usage add_library(Celix::rsa_topology_manager ALIAS rsa_topology_manager) -if (ENABLE_TESTING AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI) +if (ENABLE_TESTING AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI AND BUILD_RSA_DISCOVERY_COMMON) find_package(jansson REQUIRED) add_subdirectory(tms_tst) endif () diff --git a/bundles/shell/shell_bonjour/CMakeLists.txt b/bundles/shell/shell_bonjour/CMakeLists.txt index 898f1d3d..5a1cb556 100644 --- a/bundles/shell/shell_bonjour/CMakeLists.txt +++ b/bundles/shell/shell_bonjour/CMakeLists.txt @@ -35,8 +35,6 @@ if (SHELL_BONJOUR) ) celix_deprecated_utils_headers(bonjour_shell) celix_deprecated_framework_headers(bonjour_shell) - add_library(Celix::bonjour_shell ALIAS bonjour_shell) - target_include_directories(bonjour_shell PRIVATE "${PROJECT_SOURCE_DIR}/utils/public/include" @@ -44,6 +42,8 @@ if (SHELL_BONJOUR) private/include ) target_link_libraries(bonjour_shell PRIVATE ${LIBXML2_LIBRARIES} DNSSD::DNSSD Celix::shell_api) + install_celix_bundle(bonjour_shell EXPORT celix COMPONENT bonjour_shell) + add_library(Celix::bonjour_shell ALIAS bonjour_shell) add_celix_container("bonjour_shell_deploy" BUNDLES Celix::shell diff --git a/cmake/CelixDeps.cmake.in b/cmake/CelixDeps.cmake.in index 7a046d86..c4c09755 100644 --- a/cmake/CelixDeps.cmake.in +++ b/cmake/CelixDeps.cmake.in @@ -6,10 +6,6 @@ $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::deployment_admin>>:find_dependency(ZLIB) $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::dfi>>:find_dependency(libffi)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::dfi>>:find_dependency(jansson)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::etcdlib>>:find_dependency(jansson)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_serializer_json>>:find_dependency(jansson)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_serializer_avrobin>>:find_dependency(jansson)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_discovery_etcd>>:find_dependency(jansson)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_websocket>>:find_dependency(jansson)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::framework>>:find_dependency(CURL)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::etcdlib>>:find_dependency(CURL)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::RsaConfiguredDiscovery>>:find_dependency(RapidJSON)> @@ -20,4 +16,6 @@ $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_zmq>>:find_dependency $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::pubsub_admin_nanomsg>>:find_dependency(NanoMsg)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::http_admin_api>>:find_dependency(civetweb)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::rsa_discovery>>:find_dependency(civetweb)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::rsa_dfi>>:find_dependency(civetweb)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::rsa_discovery_zeroconf>>:find_dependency(DNSSD)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::bonjour_shell>>:find_dependency(DNSSD)> diff --git a/conanfile.py b/conanfile.py index 6bec65f3..129b3a3d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -210,13 +210,6 @@ class CelixConan(ConanFile): if not self.options.enable_testing: self.options.build_pubsub_integration = False self.options.enable_code_coverage = False - if not self.options.build_remote_service_admin: - self.options.build_rsa_remote_service_admin_dfi = False - self.options.build_rsa_discovery_configured = False - self.options.build_rsa_discovery_etcd = False - self.options.build_rsa_json_rpc = False - self.options.build_rsa_remote_service_admin_shm_v2 = False - self.options.build_rsa_discovery_zeroconf = False if self.options.build_shell_bonjour: self.options.build_shell = True @@ -291,7 +284,9 @@ class CelixConan(ConanFile): if self.options.build_rsa_discovery_configured: self.options.build_rsa_discovery_common = True - if self.options.build_rsa_discovery_common: + if self.options.build_rsa_discovery_common or self.options.build_rsa_discovery_zeroconf \ + or self.options.build_rsa_remote_service_admin_dfi or self.options.build_rsa_json_rpc \ + or self.options.build_rsa_remote_service_admin_shm_v2: self.options.build_remote_service_admin = True if self.options.build_remote_service_admin: @@ -373,15 +368,14 @@ class CelixConan(ConanFile): self.options['zeromq'].shared = True self.requires("czmq/4.2.0") self.options['czmq'].shared = True - if self.options.build_http_admin or self.options.build_rsa_discovery_common: + if self.options.build_http_admin or self.options.build_rsa_discovery_commonor \ + or self.options.build_rsa_remote_service_admin_dfi: self.requires("civetweb/1.15") self.options['civetweb'].shared = True if self.options.build_celix_dfi: self.requires("libffi/[>=3.2.1 <4.0.0]") self.options['libffi'].shared = True - if self.options.build_celix_dfi or self.options.build_celix_etcdlib \ - or self.options.build_pubsub_json_serializer or self.options.build_pubsub_avrobin_serializer \ - or self.options.build_pubsub_discovery_etcd or self.options.build_pubsub_psa_ws: + if self.options.build_celix_dfi or self.options.build_celix_etcdlib: self.requires("jansson/[>=2.12 <3.0.0]") self.options['jansson'].shared = True if self.options.build_rsa_discovery_zeroconf or self.options.build_shell_bonjour: diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index c8733c9c..89b5ac0a 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -70,9 +70,9 @@ if (UTILS) target_compile_definitions(utils PRIVATE -DUSE_FILE32API) endif () -if (NOT APPLE) - set(UTILS_PUBLIC_DEPS ${UTILS_PUBLIC_DEPS} rt) -endif () + if (NOT APPLE) + set(UTILS_PUBLIC_DEPS ${UTILS_PUBLIC_DEPS} rt) + endif () target_include_directories(utils PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
