From 1b6a20e7a28dfec5a4e6f9b699490d49c44c9857 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 8 Nov 2017 13:40:27 -0800 Subject: llvm: fix static linking I left a hack patch in a pull request for LLVM, and the result is that LLVM doesn't link with static builds. The real problem was that some distros have pkg-config for tinfo, other's don't, so the correct solution is to use cpp_compiler.find_library if dependency() fails. --- test cases/frameworks/15 llvm/meson.build | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test cases/frameworks/15 llvm/meson.build b/test cases/frameworks/15 llvm/meson.build index eb1b8d5..5211006 100644 --- a/test cases/frameworks/15 llvm/meson.build +++ b/test cases/frameworks/15 llvm/meson.build @@ -9,6 +9,12 @@ assert(d.found() == false, 'ancient llvm module found') d = dependency('llvm', optional_modules : 'not-found', required : false) assert(d.found() == true, 'optional module stopped llvm from being found.') +dep_tinfo = dependency('tinfo', required : false) +if not dep_tinfo.found() + cpp = meson.get_compiler('cpp') + dep_tinfo = cpp.find_library('tinfo') +endif + foreach static : [true, false] llvm_dep = dependency( 'llvm', @@ -22,9 +28,8 @@ foreach static : [true, false] 'sum-@0@'.format(name), 'sum.c', dependencies : [ - llvm_dep, + llvm_dep, dep_tinfo, dependency('zlib'), - dependency('glib-2.0'), meson.get_compiler('c').find_library('dl', required : false), ] ) -- cgit v1.1