This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/transitive-private-deps
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 13425e301ed5d190cfcdec33d2fcf4df78a4fe67
Author: PengZheng <[email protected]>
AuthorDate: Mon Jun 19 15:57:42 2023 +0800

    Revert "A better workaround of the issue of private linking of transitive 
dependencies."
    
    This does not work for downstream consumers.
    
    This reverts commit 40df914a5a4e00697a8ef9d0d0dbb014f43ec883.
---
 conanfile.py                             | 10 +++++-----
 examples/conan_test_package/conanfile.py | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/conanfile.py b/conanfile.py
index 5b47ee1c..604fafd4 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -272,16 +272,16 @@ class CelixConan(ConanFile):
             self._enable_error_injectors()
         self._cmake.definitions["CELIX_ERR_BUFFER_SIZE"] = 
self.options.celix_err_buffer_size
         self._cmake.definitions["CMAKE_PROJECT_Celix_INCLUDE"] = 
os.path.join(self.build_folder, "conan_paths.cmake")
-        # the following together with the imports method is a workaround 
https://github.com/conan-io/conan/issues/7192
-        self._cmake.definitions["CMAKE_BUILD_RPATH"] = 
os.path.join(self.build_folder, "lib")
+        # the following is workaround for 
https://github.com/conan-io/conan/issues/7192
+        if self.settings.os == "Linux":
+            self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = 
"-Wl,--unresolved-symbols=ignore-in-shared-libs"
+        elif self.settings.os == "Macos":
+            self._cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = 
"-Wl,-undefined -Wl,dynamic_lookup"
         self.output.info(self._cmake.definitions)
         v = tools.Version(self.version)
         self._cmake.configure(defs={'CELIX_MAJOR': v.major, 'CELIX_MINOR': 
v.minor, 'CELIX_MICRO': v.patch})
         return self._cmake
 
-    def imports(self):
-        self.copy("*.so*", "lib", "lib")
-
     def build(self):
         # self._patch_sources()
         cmake = self._configure_cmake()
diff --git a/examples/conan_test_package/conanfile.py 
b/examples/conan_test_package/conanfile.py
index 39ae8e3c..327a61a7 100644
--- a/examples/conan_test_package/conanfile.py
+++ b/examples/conan_test_package/conanfile.py
@@ -52,14 +52,14 @@ class TestPackageConan(ConanFile):
         cmake.definitions["TEST_PROMISES"] = 
self.options["celix"].build_promises
         cmake.definitions["TEST_PUSHSTREAMS"] = 
self.options["celix"].build_pushstreams
         cmake.definitions["CMAKE_PROJECT_test_package_INCLUDE"] = 
os.path.join(self.build_folder, "conan_paths.cmake")
-        # the following together with the imports method is a workaround 
https://github.com/conan-io/conan/issues/7192
-        cmake.definitions["CMAKE_BUILD_RPATH"] = 
os.path.join(self.build_folder, "lib")
+        # the following is workaround 
https://github.com/conan-io/conan/issues/7192
+        if self.settings.os == "Linux":
+            cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = 
"-Wl,--unresolved-symbols=ignore-in-shared-libs"
+        elif self.settings.os == "Macos":
+            cmake.definitions["CMAKE_EXE_LINKER_FLAGS"] = "-Wl,-undefined 
-Wl,dynamic_lookup"
         cmake.configure()
         cmake.build()
 
-    def imports(self):
-        self.copy("*.so*", "lib", "lib")
-
     def test(self):
         if not tools.cross_building(self, skip_x64_x86=True):
             self.run("./use_framework", run_environment=True)

Reply via email to