aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/frameworks/19 pcap/meson.build
blob: 051e49eedb29806a069c66429dc3d9450490465a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
project('pcap test', 'c')

pcap_dep = dependency('pcap', version : '>=1.0', required: false)

if not pcap_dep.found()
  error('MESON_SKIP_TEST pcap not found.')
endif

pcap_ver = pcap_dep.version()
assert(pcap_ver.split('.').length() > 1, 'pcap version is "@0@"'.format(pcap_ver))

e = executable('pcap_prog', 'pcap_prog.c', dependencies : pcap_dep)

test('pcaptest', e)

# Ensure discovery via the configuration tools work also
pcap_dep = dependency('pcap', version : '>=1.0', method : 'pcap-config')
pcap_dep = dependency('pcap', version : '>=1.0', method : 'config-tool')

# Check we can apply a version constraint
dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'pkg-config', required: false)
dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'config-tool')