summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2019-11-22 10:09:57 +0100
committerCristian Adam <cristian.adam@qt.io>2019-11-22 09:27:07 +0000
commitb9eb81fe1f5cfc1d74e7ec30a2eb7407063f89b3 (patch)
tree99bbf516e7e13276738cf170c08b7542e4390848 /cmake
parent467d92ba6c2a67430ef79923052a7754f1e240b4 (diff)
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapLibClang.cmake9
1 files changed, 8 insertions, 1 deletions
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