Skip to content

Commit 3a76972

Browse files
authored
cmake: fix zlib handling in legacy recipe built from source (#29116)
1 parent 925ee98 commit 3a76972

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

recipes/cmake/3.x.x/conanfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def config_options(self):
3939
def requirements(self):
4040
if self.options.get_safe("with_openssl", default=False):
4141
self.requires("openssl/[>=1.1 <4]")
42+
self.requires("zlib/[>=1.2.11 <2]")
4243

4344
def validate_build(self):
4445
if self.settings.os == "Windows" and self.options.bootstrap:
@@ -121,6 +122,7 @@ def generate(self):
121122
# the windows SDK available in the system
122123
if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"):
123124
tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0"
125+
tc.cache_variables["CMAKE_USE_SYSTEM_ZLIB"] = True
124126
tc.generate()
125127
tc = CMakeDeps(self)
126128
# CMake try_compile failure: https://github.com/conan-io/conan-center-index/pull/16073#discussion_r1110037534

0 commit comments

Comments
 (0)