aboutsummaryrefslogtreecommitdiff
path: root/test cases/osx
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-01-31 14:41:21 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-01-31 20:12:21 +0530
commit42b48cda9848758a68711b731441a0074874ba6b (patch)
tree4599a5d35c90715110437c15f4e3c3c633e53166 /test cases/osx
parent87652c80dcbf7fbf61e3883aec74b2271c65b041 (diff)
downloadmeson-42b48cda9848758a68711b731441a0074874ba6b.zip
meson-42b48cda9848758a68711b731441a0074874ba6b.tar.gz
meson-42b48cda9848758a68711b731441a0074874ba6b.tar.bz2
tests: Don't require pkg-config for macOS tests
Only require it on the CI or if pkg-config is found.
Diffstat (limited to 'test cases/osx')
-rw-r--r--test cases/osx/2 library versions/meson.build32
-rw-r--r--test cases/osx/2 library versions/require_pkgconfig.py9
2 files changed, 31 insertions, 10 deletions
diff --git a/test cases/osx/2 library versions/meson.build b/test cases/osx/2 library versions/meson.build
index 26f945a..0d21a3a 100644
--- a/test cases/osx/2 library versions/meson.build
+++ b/test cases/osx/2 library versions/meson.build
@@ -1,15 +1,27 @@
project('library versions', 'c')
-zlib_dep = dependency('zlib')
-
-some = shared_library('some', 'lib.c',
- # duplicate the rpath again, in order
- # to test Meson's RPATH deduplication
- build_rpath : zlib_dep.get_pkgconfig_variable('libdir'),
- dependencies : zlib_dep,
- version : '1.2.3',
- soversion : '7',
- install : true)
+if run_command(find_program('require_pkgconfig.py'), check: true).stdout().strip() == 'yes'
+ required = true
+else
+ required = false
+endif
+
+zlib_dep = dependency('zlib', required: required)
+if zlib_dep.found()
+ some = shared_library('some', 'lib.c',
+ # duplicate the rpath again, in order
+ # to test Meson's RPATH deduplication
+ build_rpath : zlib_dep.get_pkgconfig_variable('libdir'),
+ dependencies : zlib_dep,
+ version : '1.2.3',
+ soversion : '7',
+ install : true)
+else
+ some = shared_library('some', 'lib.c',
+ version : '1.2.3',
+ soversion : '7',
+ install : true)
+endif
noversion = shared_library('noversion', 'lib.c',
install : true)
diff --git a/test cases/osx/2 library versions/require_pkgconfig.py b/test cases/osx/2 library versions/require_pkgconfig.py
new file mode 100644
index 0000000..3d228aa
--- /dev/null
+++ b/test cases/osx/2 library versions/require_pkgconfig.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import os
+import shutil
+
+if 'CI' in os.environ or shutil.which('pkg-config'):
+ print('yes')
+else:
+ print('no')