tests/llvm: Test both cmake and llvm-config methods

This commit is contained in:
Dylan Baker 2019-07-01 15:04:56 -07:00 committed by Jussi Pakkanen
parent 54b1c43277
commit 38f2034162
1 changed files with 24 additions and 20 deletions

View File

@ -31,25 +31,29 @@ if not dep_tinfo.found()
dep_tinfo = cpp.find_library('tinfo', required: false) dep_tinfo = cpp.find_library('tinfo', required: false)
endif endif
foreach static : [true, false] foreach method : ['config-tool', 'cmake']
llvm_dep = dependency( foreach static : [true, false]
'llvm', message('Trying method @0@ for @1@ link'.format(method, static ? 'static' : 'dynamic'))
modules : ['bitwriter', 'asmprinter', 'executionengine', 'target', llvm_dep = dependency(
'mcjit', 'nativecodegen', 'amdgpu'], 'llvm',
required : false, modules : ['bitwriter', 'asmprinter', 'executionengine', 'target',
static : static, 'mcjit', 'nativecodegen', 'amdgpu'],
) required : false,
if llvm_dep.found() static : static,
name = static ? 'static' : 'dynamic' method : method,
executable(
'sum-@0@'.format(name),
'sum.c',
dependencies : [
llvm_dep, dep_tinfo,
# zlib will be statically linked on windows
dependency('zlib', required : host_machine.system() != 'windows'),
meson.get_compiler('c').find_library('dl', required : false),
]
) )
endif if llvm_dep.found()
name = static ? 'static' : 'dynamic'
executable(
'sum-@0@-@1@'.format(name, method),
'sum.c',
dependencies : [
llvm_dep, dep_tinfo,
# zlib will be statically linked on windows
dependency('zlib', required : host_machine.system() != 'windows'),
meson.get_compiler('c').find_library('dl', required : false),
]
)
endif
endforeach
endforeach endforeach