|
|
@ -1,19 +1,30 @@ |
|
|
|
project('llvmtest', ['c', 'cpp'], default_options : ['c_std=c99']) |
|
|
|
project('llvmtest', ['c', 'cpp'], default_options : ['c_std=c99']) |
|
|
|
|
|
|
|
|
|
|
|
d = dependency('llvm', required : false) |
|
|
|
d = dependency('llvm', required : false) |
|
|
|
|
|
|
|
if not d.found() |
|
|
|
|
|
|
|
d = dependency('llvm', required : false, static : true) |
|
|
|
if not d.found() |
|
|
|
if not d.found() |
|
|
|
error('MESON_SKIP_TEST llvm not found.') |
|
|
|
error('MESON_SKIP_TEST llvm not found.') |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
static = true |
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
static = false |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
d = dependency('llvm', modules : 'not-found', required : false) |
|
|
|
d = dependency('llvm', modules : 'not-found', required : false, static : static) |
|
|
|
assert(d.found() == false, 'not-found llvm module found') |
|
|
|
assert(d.found() == false, 'not-found llvm module found') |
|
|
|
|
|
|
|
|
|
|
|
d = dependency('llvm', version : '<0.1', required : false) |
|
|
|
d = dependency('llvm', version : '<0.1', required : false, static : static) |
|
|
|
assert(d.found() == false, 'ancient llvm module found') |
|
|
|
assert(d.found() == false, 'ancient llvm module found') |
|
|
|
|
|
|
|
|
|
|
|
d = dependency('llvm', optional_modules : 'not-found', required : false) |
|
|
|
d = dependency('llvm', optional_modules : 'not-found', required : false, static : static) |
|
|
|
assert(d.found() == true, 'optional module stopped llvm from being found.') |
|
|
|
assert(d.found() == true, 'optional module stopped llvm from being found.') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check we can apply a version constraint |
|
|
|
|
|
|
|
d = dependency('llvm', version : ['< 500', '>=@0@'.format(d.version())], required: false, static : static) |
|
|
|
|
|
|
|
assert(d.found() == true, 'Cannot set version constraints') |
|
|
|
|
|
|
|
|
|
|
|
dep_tinfo = dependency('tinfo', required : false) |
|
|
|
dep_tinfo = dependency('tinfo', required : false) |
|
|
|
if not dep_tinfo.found() |
|
|
|
if not dep_tinfo.found() |
|
|
|
cpp = meson.get_compiler('cpp') |
|
|
|
cpp = meson.get_compiler('cpp') |
|
|
@ -35,12 +46,10 @@ foreach static : [true, false] |
|
|
|
'sum.c', |
|
|
|
'sum.c', |
|
|
|
dependencies : [ |
|
|
|
dependencies : [ |
|
|
|
llvm_dep, dep_tinfo, |
|
|
|
llvm_dep, dep_tinfo, |
|
|
|
dependency('zlib'), |
|
|
|
# zlib will be statically linked on windows |
|
|
|
|
|
|
|
dependency('zlib', required : host_machine.system() != 'windows'), |
|
|
|
meson.get_compiler('c').find_library('dl', required : false), |
|
|
|
meson.get_compiler('c').find_library('dl', required : false), |
|
|
|
] |
|
|
|
] |
|
|
|
) |
|
|
|
) |
|
|
|
endif |
|
|
|
endif |
|
|
|
endforeach |
|
|
|
endforeach |
|
|
|
|
|
|
|
|
|
|
|
# Check we can apply a version constraint |
|
|
|
|
|
|
|
dependency('llvm', version: '>=@0@'.format(d.version())) |
|
|
|
|
|
|
|