diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-07 10:33:45 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-31 09:22:25 -0800 |
commit | d87955f9905f569588baabef1de76a245ff92b2e (patch) | |
tree | e885a30884e7675b71f2785706c6e19d26f1c936 | |
parent | 5f51ee2fc850a417f6ca1afcf158b21be9150c88 (diff) | |
download | meson-d87955f9905f569588baabef1de76a245ff92b2e.zip meson-d87955f9905f569588baabef1de76a245ff92b2e.tar.gz meson-d87955f9905f569588baabef1de76a245ff92b2e.tar.bz2 |
dependencies: Add system zlib method for freebsd and dragonflybsd
I've tested this on FreeBSD, and dragonfly's userland is close enough
I'm willing to call it good without testing. OpenBSD and NetBSD also
have a zlib in their base configurations, but I'm not confident enough
to enable those without testing.
-rw-r--r-- | mesonbuild/dependencies/dev.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index c4eeaf1..8ba654b 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -456,13 +456,18 @@ class ZlibSystemDependency(ExternalDependency): def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]): super().__init__(name, environment, kwargs) + m = self.env.machines[self.for_machine] + # I'm not sure this is entirely correct. What if we're cross compiling # from something to macOS? - if (self.env.machines[self.for_machine].is_darwin() and - isinstance(self.clib_compiler, (AppleClangCCompiler, AppleClangCPPCompiler))): + 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, xcode/clang will do that for us. + + # No need to set includes, + # on macos xcode/clang will do that for us. + # on freebsd zlib.h is in /usr/include v, _ = self.clib_compiler.get_define('ZLIB_VERSION', '#include <zlib.h>', self.env, [], [self]) self.version = v.strip('"') |