| 1 |
project('dub-with-deps-example', ['d']) |
| 2 |
|
| 3 |
dub_exe = find_program('dub', required : false) |
| 4 |
if not dub_exe.found() |
| 5 |
error('MESON_SKIP_TEST: Dub not found') |
| 6 |
endif |
| 7 |
|
| 8 |
dub_ver = dub_exe.version() |
| 9 |
if dub_ver.version_compare('>1.31.1', '<1.35.0') |
| 10 |
error('MESON_SKIP_TEST: Incompatible Dub version') |
| 11 |
endif |
| 12 |
|
| 13 |
if meson.get_compiler('d').get_id() == 'gcc' |
| 14 |
error('MESON_SKIP_TEST: can\'t build dependencies with GDC') |
| 15 |
endif |
| 16 |
|
| 17 |
dc = meson.get_compiler('d').cmd_array()[0] |
| 18 |
arch = host_machine.cpu_family() |
| 19 |
|
| 20 |
if host_machine.system() == 'windows' |
| 21 |
# check if toolchain is 32bits |
| 22 |
sz = meson.get_compiler('d').sizeof('void*') |
| 23 |
if arch == 'x86' or sz == 4 |
| 24 |
arch = 'x86_mscoff' |
| 25 |
endif |
| 26 |
endif |
| 27 |
|
| 28 |
run_command('dub', 'run', 'dub-build-deep', '--yes', '--', 'xlsx', '--compiler', dc, '--arch', arch, |
| 29 |
check: true, |
| 30 |
) |
| 31 |
|
| 32 |
xlsx_dep = dependency('xlsx', method: 'dub') |
| 33 |
|
| 34 |
test_exe = executable('test-test6', 'test.d', dependencies: xlsx_dep) |
| 35 |
|
| 36 |
test('test dub with deps', test_exe) |