Skip to content

Commit

Permalink
zlib-ng: provide "zlib" in compatilibity mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekto89 committed Nov 6, 2023
1 parent 90d0025 commit f888ee0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions recipes/zlib-ng/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class ZlibNgConan(ConanFile):
"with_reduced_mem": False,
}

provides = []

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -51,6 +53,8 @@ def configure(self):
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")
if self.options.zlib_compat:
self.provides.append("zlib")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down Expand Up @@ -106,6 +110,12 @@ def package_info(self):
self.cpp_info.libs = [f"z{suffix}"]
if self.options.zlib_compat:
self.cpp_info.defines.append("ZLIB_COMPAT")
#copied from zlib
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_file_name", "ZLIB")
self.cpp_info.set_property("cmake_target_name", "ZLIB::ZLIB")
self.cpp_info.names["cmake_find_package"] = "ZLIB"
self.cpp_info.names["cmake_find_package_multi"] = "ZLIB"
if self.options.with_gzfileop:
self.cpp_info.defines.append("WITH_GZFILEOP")
if not self.options.with_new_strategies:
Expand Down

0 comments on commit f888ee0

Please sign in to comment.