[gnome-builder] meson-build: fix the libclang check



commit 4319ce51838f5b2ac063833d1cb22422caa1baa0
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Sun May 7 23:12:02 2017 +0800

    meson-build: fix the libclang check
    
    Use args argument in cc.has_header because it doesn't support prefix.
    
    Add dirs argument to cc.find_library because we have to add extra
    search paths to find libclang on systems not installing it in the
    default search path. Replace 'llvm-config --ldflags' with
    'llvm-config --libdir' because cc.find_library uses dirs argument
    instead of args.
    
    Remove link_args from clang_dep because using cc.find_library makes
    meson use the full path to the library. -L flags are not needed here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782296

 plugins/clang/meson.build |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/plugins/clang/meson.build b/plugins/clang/meson.build
index 69bb314..f24c76f 100644
--- a/plugins/clang/meson.build
+++ b/plugins/clang/meson.build
@@ -43,19 +43,18 @@ if ret.returncode() != 0
 endif
 clang_include = ret.stdout().strip()
 
-ret = run_command(llvm_config, '--ldflags')
+ret = run_command(llvm_config, '--libdir')
 if ret.returncode() != 0
   error('clang: Failed to run ' + llvm_config.path())
 endif
-clang_ldflags = ret.stdout().strip().split(' ')
+clang_libdir = ret.stdout().strip().split(' ')
 
-if not cc.has_header('clang-c/Index.h', prefix: clang_include)
+if not cc.has_header('clang-c/Index.h', args: '-I' + clang_include)
   error('clang: Failed to find headers')
 endif
 
 clang_dep = declare_dependency(
-  dependencies: cc.find_library('libclang'),
-  link_args: clang_ldflags,
+  dependencies: cc.find_library('libclang', dirs: clang_libdir),
   include_directories: include_directories(clang_include),
 )
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]