Skip to content

Commit

Permalink
Merge pull request #1326 from SpaceIm/fix/xz_utils/system-libs
Browse files Browse the repository at this point in the history
Fix/xz utils/system libs
  • Loading branch information
jgsogo authored Apr 18, 2020
2 parents 0a10580 + 6a540fc commit db48f74
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 6 additions & 2 deletions recipes/xz_utils/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -130,6 +132,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"
Expand Down
8 changes: 2 additions & 6 deletions recipes/xz_utils/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
6 changes: 3 additions & 3 deletions recipes/xz_utils/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit db48f74

Please sign in to comment.