~mmach/netext73/meson

« back to all changes in this revision

Viewing changes to test cases/common/228 zlib/meson.build

  • Committer: mmach
  • Date: 2021-02-15 11:29:44 UTC
  • Revision ID: netbit73@gmail.com-20210215112944-fpso7tr2yog0tam1
57

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
project('zlib system dependency', 'c')
2
 
 
3
 
if not ['darwin', 'freebsd', 'dragonfly', 'windows'].contains(host_machine.system())
4
 
  error('MESON_SKIP_TEST only applicable on macOS, FreeBSD, DragonflyBSD, and Windows.')
5
 
endif
6
 
 
7
 
cc = meson.get_compiler('c')
8
 
 
9
 
if host_machine.system() == 'darwin' and cc.get_id() != 'clang'
10
 
  # this will only work on mac if using Apple's clang compiler, but there is no
11
 
  # way in the meson source level to differentiate apple clang and llvm clang
12
 
  # In the meson CI only apple clang is tested
13
 
  error('MESON_SKIP_TEST on macOS only clang is supported.')
14
 
endif
15
 
 
16
 
if not (cc.find_library('z', required: false).found() or
17
 
        cc.find_library('zlib', required : false).found() or
18
 
        cc.find_library('zlib1', required : false).found())
19
 
  error('MESON_SKIP_TEST Cannot seem to find zlib via find_library, this test will probably fail.')
20
 
endif
21
 
 
22
 
z = dependency('zlib', method : 'system')
23
 
assert(z.version().version_compare('>= 1.2'), 'Version does not seem to have been detected correctly.')