summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-09-10 10:07:03 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-09-10 10:30:10 +0200
commitf72b7a68221898333c3ea032d493a9efd5a68af6 (patch)
tree80660725c8049e4ba45e363ea65b003e6be0d766 /cmake
parent0c9893ce9fa3b18658ee24788fd9239c6688162c (diff)
downloadqttools-f72b7a68221898333c3ea032d493a9efd5a68af6.tar.gz
CMake: Don't add LLVM_INSTALL_DIR to CMAKE_FIND_ROOT_PATH
The original intention of adding LLVM_INSTALL_DIR to CMAKE_FIND_ROOT_PATH was to make it easier for a developer to specify the location of Clang even when cross-compiling. Unfortunately our CI has LLVM_INSTALL_DIR pointing to the regular Linux host libclang directory. This causes the qemu builds to pick up the host libclang libraries and trying to link them to the arm binaries, which of course fails. Remove addition to CMAKE_FIND_ROOT_PATH. If somebody actually needs to cross-compile qdoc / lupdate with an arm clang, it can still be specified / found via the usual CMake means, like specifying -DCMAKE_PREFIX_PATH and -DCMAKE_FIND_ROOT_PATH on the command line / toolchain file, or by specifying -DClang_DIR. Task-number: QTBUG-83968 Change-Id: Ic07dae889685c10bad93525daa5a1dbd4dd8f388 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapLibClang.cmake8
1 files changed, 0 insertions, 8 deletions
diff --git a/cmake/FindWrapLibClang.cmake b/cmake/FindWrapLibClang.cmake
index 51afea0f1..0cd388a5e 100644
--- a/cmake/FindWrapLibClang.cmake
+++ b/cmake/FindWrapLibClang.cmake
@@ -5,25 +5,17 @@ endif()
if(DEFINED ENV{LLVM_INSTALL_DIR})
set(__qt_wrap_clang_backup_prefix "${CMAKE_PREFIX_PATH}")
- set(__qt_wrap_clang_backup_root_path ${CMAKE_FIND_ROOT_PATH})
-
list(PREPEND CMAKE_PREFIX_PATH "$ENV{LLVM_INSTALL_DIR}")
- list(PREPEND CMAKE_FIND_ROOT_PATH "$ENV{LLVM_INSTALL_DIR}")
elseif(DEFINED CACHE{LLVM_INSTALL_DIR})
set(__qt_wrap_clang_backup_prefix "${CMAKE_PREFIX_PATH}")
- set(__qt_wrap_clang_backup_root_path ${CMAKE_FIND_ROOT_PATH})
-
list(PREPEND CMAKE_PREFIX_PATH "${LLVM_INSTALL_DIR}")
- list(PREPEND CMAKE_FIND_ROOT_PATH "${LLVM_INSTALL_DIR}")
endif()
find_package(Clang CONFIG)
if(__qt_wrap_clang_backup_prefix)
set(CMAKE_PREFIX_PATH "${__qt_wrap_clang_backup_prefix}")
- set(CMAKE_FIND_ROOT_PATH "${__qt_wrap_clang_backup_root_path}")
unset(__qt_wrap_clang_backup_prefix)
- unset(__qt_wrap_clang_backup_root_path)
endif()
set(WrapLibClang_FOUND FALSE)