tests: Don't require pkg-config for macOS tests

Only require it on the CI or if pkg-config is found.
pull/4790/head
Nirbheek Chauhan 6 years ago committed by Nirbheek Chauhan
parent 87652c80dc
commit 42b48cda98
  1. 32
      test cases/osx/2 library versions/meson.build
  2. 9
      test cases/osx/2 library versions/require_pkgconfig.py

@ -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)

@ -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')
Loading…
Cancel
Save