From f72b7a68221898333c3ea032d493a9efd5a68af6 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 10 Sep 2020 10:07:03 +0200 Subject: 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 --- cmake/FindWrapLibClang.cmake | 8 -------- 1 file changed, 8 deletions(-) (limited to 'cmake') 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) -- cgit v1.2.1