aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-02-07 21:15:55 +0200
committerGitHub <noreply@github.com>2020-02-07 21:15:55 +0200
commit31d89a4ed24987658b0caf8b7fe1e1c0df01ecfb (patch)
tree812825975b19ae40a4ffd2d572e5a120ffc2c730 /test cases
parent3689e49f4eb8cd4a7b1ec396610cdfcecd88a009 (diff)
parentb0c219b9bb37e2d60992ff45796168ae0bf63b4b (diff)
downloadmeson-31d89a4ed24987658b0caf8b7fe1e1c0df01ecfb.zip
meson-31d89a4ed24987658b0caf8b7fe1e1c0df01ecfb.tar.gz
meson-31d89a4ed24987658b0caf8b7fe1e1c0df01ecfb.tar.bz2
Merge pull request #6421 from dcbaker/zlib-system-dep
Add a "system" dependency for zlib
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/228 zlib/meson.build23
1 files changed, 23 insertions, 0 deletions
diff --git a/test cases/common/228 zlib/meson.build b/test cases/common/228 zlib/meson.build
new file mode 100644
index 0000000..c53f71e
--- /dev/null
+++ b/test cases/common/228 zlib/meson.build
@@ -0,0 +1,23 @@
+project('zlib system dependency', 'c')
+
+if not ['darwin', 'freebsd', 'dragonfly', 'windows'].contains(host_machine.system())
+ error('MESON_SKIP_TEST only applicable on macOS, FreeBSD, DragonflyBSD, and Windows.')
+endif
+
+cc = meson.get_compiler('c')
+
+if host_machine.system() == 'darwin' and cc.get_id() != 'clang'
+ # this will only work on mac if using Apple's clang compiler, but there is no
+ # way in the meson source level to differentiate apple clang and llvm clang
+ # In the meson CI only apple clang is tested
+ error('MESON_SKIP_TEST on macOS only clang is supported.')
+endif
+
+if not (cc.find_library('z', required: false).found() or
+ cc.find_library('zlib', required : false).found() or
+ cc.find_library('zlib1', required : false).found())
+ error('MESON_SKIP_TEST Cannot seem to find zlib via find_library, this test will probably fail.')
+endif
+
+z = dependency('zlib', method : 'system')
+assert(z.version().version_compare('>= 1.2'), 'Version does not seem to have been detected correctly.')