| 1 |
project('pcap test', 'c') |
| 2 |
|
| 3 |
pcap_dep = dependency('pcap', version : '>=1.0', required: false) |
| 4 |
|
| 5 |
if not pcap_dep.found() |
| 6 |
error('MESON_SKIP_TEST pcap not found.') |
| 7 |
endif |
| 8 |
|
| 9 |
pcap_ver = pcap_dep.version() |
| 10 |
assert(pcap_ver.split('.').length() > 1, 'pcap version is "@0@"'.format(pcap_ver)) |
| 11 |
|
| 12 |
e = executable('pcap_prog', 'pcap_prog.c', dependencies : pcap_dep) |
| 13 |
|
| 14 |
test('pcaptest', e) |
| 15 |
|
| 16 |
# Ensure discovery via the configuration tools work also |
| 17 |
pcap_dep = dependency('pcap', version : '>=1.0', method : 'pcap-config') |
| 18 |
pcap_dep = dependency('pcap', version : '>=1.0', method : 'config-tool') |
| 19 |
|
| 20 |
# Check we can apply a version constraint |
| 21 |
dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'pkg-config', required: false) |
| 22 |
dependency('pcap', version: '>=@0@'.format(pcap_dep.version()), method: 'config-tool') |