From 49b50374968357dcf74cc6f7876e8649c6cf022a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 30 Apr 2021 10:30:51 -0700 Subject: [PATCH] dependencies/zlib: System Dependency needs a clib_compiler on windows Otherwise it'll except when it tries to get an attribute from None that doesn't exist. --- mesonbuild/dependencies/dev.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index e9181bd9a..07bf87a7a 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -475,13 +475,18 @@ class ZlibSystemDependency(ExternalDependency): # from something to macOS? if ((m.is_darwin() and isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))) or m.is_freebsd() or m.is_dragonflybsd()): - self.is_found = True - self.link_args = ['-lz'] - # No need to set includes, # on macos xcode/clang will do that for us. # on freebsd zlib.h is in /usr/include + + self.is_found = True + self.link_args = ['-lz'] elif m.is_windows(): + # Without a clib_compiler we can't find zlib, s just give up. + if self.clib_compiler is None: + self.is_found = False + return + if self.clib_compiler.get_argument_syntax() == 'msvc': libs = ['zlib1' 'zlib'] else: