Debian Codegraph @

test cases/common/203 find_library and headers/meson.build

raw
1 project('find library and headers', 'c')
2
3 cc = meson.get_compiler('c')
4
5 if not cc.find_library('z', required : false).found()
6 error('MESON_SKIP_TEST: zlib not found.')
7 endif
8
9 lib = cc.find_library('z',
10 has_headers : 'foo.h',
11 required : false)
12 assert(not lib.found(), 'Header should be missing')
13
14 lib = cc.find_library('z',
15 has_headers : 'foo.h',
16 header_include_directories : include_directories('.'))
17 assert(lib.found(), 'Header should be found')
18
19 lib = cc.find_library('z',
20 has_headers : ['foo.h', 'bar.h'],
21 header_include_directories : include_directories('.'),
22 required : false)
23 assert(not lib.found(), 'One header should be missing')