From b1e7ce84cc6ee4612313734bc4e8055a959ea078 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 18 Nov 2021 17:24:46 +0200 Subject: [PATCH] meson: try to find clang-cpp before going through each module Signed-off-by: Lionel Landwerlin Acked-by: Jason Ekstrand Part-of: --- meson.build | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 8ab5627..1b10d85 100644 --- a/meson.build +++ b/meson.build @@ -1783,17 +1783,21 @@ dep_clang = null_dep if with_clc llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') - clang_modules = [ - 'clangBasic', 'clangAST', 'clangCodeGen', 'clangLex', - 'clangDriver', 'clangFrontend', 'clangFrontendTool', - 'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization', - 'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis' - ] + dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false) + + if not dep_clang.found() + clang_modules = [ + 'clangBasic', 'clangAST', 'clangCodeGen', 'clangLex', + 'clangDriver', 'clangFrontend', 'clangFrontendTool', + 'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization', + 'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis' + ] - dep_clang = [] - foreach m : clang_modules - dep_clang += cpp.find_library(m, dirs : llvm_libdir, required : true) - endforeach + dep_clang = [] + foreach m : clang_modules + dep_clang += cpp.find_library(m, dirs : llvm_libdir, required : true) + endforeach + endif endif # Be explicit about only using this lib on Windows, to avoid picking -- 2.7.4