[gnome-builder/wip/tingping/llvm-dep] build: Use Meson's built-in llvm dependency



commit 49dcd74ad27622d164af55e4710e42e9d8e41be1
Author: Patrick Griffis <tingping tingping se>
Date:   Mon Jan 8 18:05:26 2018 -0500

    build: Use Meson's built-in llvm dependency

 meson.build                   |    2 +-
 src/plugins/clang/meson.build |   27 ++++-----------------------
 2 files changed, 5 insertions(+), 24 deletions(-)
---
diff --git a/meson.build b/meson.build
index 7caf19a..991281d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
 project('gnome-builder', 'c',
           license: 'GPL3+',
           version: '3.27.3',
-    meson_version: '>= 0.42.0',
+    meson_version: '>= 0.44.0',
   default_options: [
                      'c_std=gnu11',
                      'cpp_std=c++11',
diff --git a/src/plugins/clang/meson.build b/src/plugins/clang/meson.build
index 4f01553..d4ea6d4 100644
--- a/src/plugins/clang/meson.build
+++ b/src/plugins/clang/meson.build
@@ -36,29 +36,10 @@ clang_sources = [
   'clang-plugin.c',
 ]
 
-llvm_config = find_program(
-  'llvm-config',
-  'llvm-config-5.0', 'llvm-config50',
-  'llvm-config-4.0', 'llvm-config40',
-  'llvm-config-3.9', 'llvm-config39',
-  'llvm-config-3.8', 'llvm-config38',
-  'llvm-config-3.7', 'llvm-config37',
-  'llvm-config-3.6', 'llvm-config36',
-  'llvm-config-3.5', 'llvm-config35',
-  'llvm-config-6.0', 'llvm-config-devel',
-)
-
-ret = run_command(llvm_config, '--includedir')
-if ret.returncode() != 0
-  error('clang: Failed to run ' + llvm_config.path())
-endif
-clang_include = ret.stdout().strip()
-
-ret = run_command(llvm_config, '--libdir')
-if ret.returncode() != 0
-  error('clang: Failed to run ' + llvm_config.path())
-endif
-clang_libdir = ret.stdout().strip().split(' ')
+add_languages('cpp') # Needed for llvm dep
+llvm_dep = dependency('llvm', version: '>= 3.5')
+clang_include = llvm_dep.get_configtool_variable('includedir')
+clang_libdir = llvm_dep.get_configtool_variable('libdir').split(' ')
 
 if not cc.has_header('clang-c/Index.h', args: '-I' + clang_include)
   error('clang: Failed to find headers')


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