From 55f92b5beea6dbdfc36c077424282a200f262b6b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 9 Apr 2020 12:34:01 +0200 Subject: [PATCH 1/3] xz_utils: add pthread to cpp_info.system_libs --- recipes/xz_utils/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py index 47492b12e84a6..e69cd10c3d88b 100644 --- a/recipes/xz_utils/all/conanfile.py +++ b/recipes/xz_utils/all/conanfile.py @@ -130,6 +130,8 @@ def package(self): def package_info(self): if not self.options.shared: self.cpp_info.defines.append("LZMA_API_STATIC") + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("pthread") self.cpp_info.libs = tools.collect_libs(self) self.cpp_info.names["pkg_config"] = "liblzma" self.cpp_info.names["cmake_find_package"] = "LibLZMA" From 62426ccf142754dd26b60da80aa8ff0f3333370b Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 9 Apr 2020 12:57:12 +0200 Subject: [PATCH 2/3] xz_utils: delete fPIC in config_options --- recipes/xz_utils/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/xz_utils/all/conanfile.py b/recipes/xz_utils/all/conanfile.py index e69cd10c3d88b..3aa6b3ed8eb55 100644 --- a/recipes/xz_utils/all/conanfile.py +++ b/recipes/xz_utils/all/conanfile.py @@ -32,11 +32,13 @@ def _effective_msbuild_type(self): # treat "RelWithDebInfo" and "MinSizeRel" as "Release" return "Debug" if self.settings.build_type == "Debug" else "Release" + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + def configure(self): del self.settings.compiler.cppstd del self.settings.compiler.libcxx - if self.settings.compiler == "Visual Studio": - del self.options.fPIC def _apply_patches(self): # Relax Windows SDK restriction From 6a540fcb8014e3adf62d3fb0aef193697e9c6917 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Thu, 9 Apr 2020 13:40:52 +0200 Subject: [PATCH 3/3] xz_utils: fix test_package --- recipes/xz_utils/all/test_package/CMakeLists.txt | 8 ++------ recipes/xz_utils/all/test_package/conanfile.py | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/recipes/xz_utils/all/test_package/CMakeLists.txt b/recipes/xz_utils/all/test_package/CMakeLists.txt index 2c93c26f9db55..34c55b9ba5a6e 100644 --- a/recipes/xz_utils/all/test_package/CMakeLists.txt +++ b/recipes/xz_utils/all/test_package/CMakeLists.txt @@ -1,12 +1,8 @@ -project(test_package) cmake_minimum_required(VERSION 2.8.11) - -set(CMAKE_VERBOSE_MAKEFILE TRUE) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -file(GLOB SOURCE_FILES *.c) - -add_executable(${PROJECT_NAME} ${SOURCE_FILES}) +add_executable(${PROJECT_NAME} main.c) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/xz_utils/all/test_package/conanfile.py b/recipes/xz_utils/all/test_package/conanfile.py index d9772f58af9f7..bd7165a553cf4 100644 --- a/recipes/xz_utils/all/test_package/conanfile.py +++ b/recipes/xz_utils/all/test_package/conanfile.py @@ -12,6 +12,6 @@ def build(self): cmake.build() def test(self): - # Test the library - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True)