diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-22 09:34:50 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-22 11:10:33 +0000 |
commit | ac6de68fe7d4fef251c101ef25812fe2198925f8 (patch) | |
tree | b50f25ecfae555483dce4f21b199392579b37ce8 | |
parent | 3cedb777ec45467d9cbc8662359b6905e86ecbbc (diff) | |
download | qttools-ac6de68fe7d4fef251c101ef25812fe2198925f8.tar.gz |
Fix linking of qdoc against libclang when cross-compiling to QNX/Android
When cross-compiling to QNX, qt_find_clang.prf is evaluated against the
target configuration, so the check for "mingw" to select the right
LLVM_INSTALL_DIR variant does not work as that's the host configuration.
So instead we must formulate the conditions differently and rely on the
fact that we are either using MSVC where the same compiler is used for
host and target architecture (even if the architectures differ) or
otherwise minwg is the host compiler (while target may be something
else).
Task-number: QTBUG-69793
Change-Id: I31acc127c94e0a8570242d1c8ea0db873f9fd253
Reviewed-by: Simo Fält <simo.falt@qt.io>
-rw-r--r-- | mkspecs/features/qt_find_clang.prf | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mkspecs/features/qt_find_clang.prf b/mkspecs/features/qt_find_clang.prf index d584d136e..bb6ca2e53 100644 --- a/mkspecs/features/qt_find_clang.prf +++ b/mkspecs/features/qt_find_clang.prf @@ -43,8 +43,15 @@ isEmpty(QDOC_USE_STATIC_LIBCLANG): QDOC_USE_STATIC_LIBCLANG = $$(QDOC_USE_STATIC cache(QDOC_USE_STATIC_LIBCLANG) for(_, $$list(_)) { # just a way to break easily - mingw:isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MINGW) - msvc:isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MSVC) + equals(QMAKE_HOST.os, Windows) { + # on Windows we have only two host compilers, MSVC or mingw. The former we never + # use for cross-compilation where it isn't also the target compiler. The latter + # is not detectable as this .prf file is evaluated against the target configuration + # and therefore checking for "mingw" won't work when the target compiler is clang (Android) + # or qcc (QNX). + msvc:isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MSVC) + else:isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR_MINGW) + } isEmpty(LLVM_INSTALL_DIR): LLVM_INSTALL_DIR = $$(LLVM_INSTALL_DIR) LLVM_INSTALL_DIR = $$clean_path($$LLVM_INSTALL_DIR) contains(QMAKE_HOST.arch, x86_64): \ |