From b9eb81fe1f5cfc1d74e7ec30a2eb7407063f89b3 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 22 Nov 2019 10:09:57 +0100 Subject: Make use of the LLVM CMake Config package By default LLVM/Clang does static builds, and the CMake Config package that it exports should be used instead of the qmake port code that we have. The change does make use of both, it just points the qmake ported code to the LLVM installation. Change-Id: I1777fea428af9db66fa2e070db53354dc04b1135 Reviewed-by: Alexandru Croitor --- cmake/FindWrapLibClang.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindWrapLibClang.cmake b/cmake/FindWrapLibClang.cmake index edda6dc4b..9ad0202b2 100644 --- a/cmake/FindWrapLibClang.cmake +++ b/cmake/FindWrapLibClang.cmake @@ -55,10 +55,17 @@ function(qt_tools_find_lib_clang) endif() endif() - if(NOT LLVM_INSTALL_DIR) + if(NOT LLVM_INSTALL_DIR AND ENV{LLVM_INSTALL_DIR}) set(LLVM_INSTALL_DIR "$ENV{LLVM_INSTALL_DIR}") endif() + if(NOT LLVM_INSTALL_DIR) + find_package(LLVM CONFIG QUIET) + if (LLVM_FOUND) + set(LLVM_INSTALL_DIR ${LLVM_BINARY_DIR}) + endif() + endif() + # Assume libclang is installed on the target system if(NOT LLVM_INSTALL_DIR) set(llvm_config_candidates -- cgit v1.2.3