You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pe...@apache.org on 2024/03/06 14:04:29 UTC

(celix) 03/03: Fix assertion failure when dep.cpp_info.libdir is None.

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

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

commit 4d831cc8562243fc1d5711eb9b06ca64e1dd94a8
Author: PengZheng <ho...@gmail.com>
AuthorDate: Wed Mar 6 22:04:09 2024 +0800

    Fix assertion failure when dep.cpp_info.libdir is None.
---
 conanfile.py                                | 3 ++-
 examples/conan_test_package_v2/conanfile.py | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/conanfile.py b/conanfile.py
index 79db0fb3..35d4e2b9 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -345,7 +345,8 @@ class CelixConan(ConanFile):
         # tc.cache_variables["CMAKE_PROJECT_Celix_INCLUDE"] = os.path.join(self.build_folder, "conan_paths.cmake")
         # the following is workaround for https://github.com/conan-io/conan/issues/7192
         for dep in self.dependencies.host.values():
-            copy(self, "*", dep.cpp_info.libdir, os.path.join(self.build_folder, "lib"))
+            if dep.cpp_info.libdir is not None:
+                copy(self, "*", dep.cpp_info.libdir, os.path.join(self.build_folder, "lib"))
         tc.cache_variables["CMAKE_BUILD_RPATH"] = os.path.join(self.build_folder, "lib")
         v = Version(self.version)
         tc.cache_variables["CELIX_MAJOR"] = str(v.major.value)
diff --git a/examples/conan_test_package_v2/conanfile.py b/examples/conan_test_package_v2/conanfile.py
index d64d38b9..9d0d63a3 100644
--- a/examples/conan_test_package_v2/conanfile.py
+++ b/examples/conan_test_package_v2/conanfile.py
@@ -67,7 +67,8 @@ class TestPackageConan(ConanFile):
         tc.cache_variables["TEST_COMPONENTS_READY_CHECK"] = celix_options.build_components_ready_check
         # the following is workaround https://github.com/conan-io/conan/issues/7192
         for dep in self.dependencies.host.values():
-            copy(self, "*", dep.cpp_info.libdir, os.path.join(self.build_folder, "lib"))
+            if dep.cpp_info.libdir is not None:
+                copy(self, "*", dep.cpp_info.libdir, os.path.join(self.build_folder, "lib"))
         tc.cache_variables["CMAKE_BUILD_RPATH"] = os.path.join(self.build_folder, "lib")
         tc.user_presets_path = False
         tc.generate()