diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-22 15:11:53 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-22 13:46:12 +0000 |
commit | 58af85972b45d905400ba1930b630e77601a2fb0 (patch) | |
tree | cfe954cb75f7d9dd5c39d70f7a8eefbb6b006742 | |
parent | ac6de68fe7d4fef251c101ef25812fe2198925f8 (diff) | |
download | qttools-58af85972b45d905400ba1930b630e77601a2fb0.tar.gz |
Fix linking libclang with mingw when cross-compiling
Commit 4ec82667f632992e827299c96d3bfd2b221a029b moved the
mingw: CLANG_LIBS += -ldl
condition from a option(host_build) .pro file to qt_find_clang.prf which
is evaluated in target scope. That means when cross-compiling, we can't
use mingw anymore as a way to detect the host compiler.
Instead, rely on MinGW being the only alternative to MSVC that we
support as a host compiler when cross-compiling. The msvc part is dealt
with earlier in the file.
Also cleaned up the LLVM_INSTALL_DIR determination that suffers from the
same symptom (commit ac6de68fe7d4fef251c101ef25812fe2198925f8), where
the msvc bit needs a proper scope for the else to work correctly.
Task-number: QTBUG-69793
Change-Id: Id544c7929b79fc3c8763d50e0bac4a3a689ade60
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | mkspecs/features/qt_find_clang.prf | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mkspecs/features/qt_find_clang.prf b/mkspecs/features/qt_find_clang.prf index bb6ca2e53..1c2fa4ffa 100644 --- a/mkspecs/features/qt_find_clang.prf +++ b/mkspecs/features/qt_find_clang.prf @@ -49,8 +49,11 @@ for(_, $$list(_)) { # just a way to break easily # 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) + 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) @@ -299,7 +302,7 @@ for(_, $$list(_)) { # just a way to break easily -lLLVMXRay !equals(QMAKE_HOST.os, Darwin): CLANG_LIBS+=-Wl,--end-group CLANG_LIBS += -lz - mingw: CLANG_LIBS += -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lversion + equals(QMAKE_HOST.os, Windows): CLANG_LIBS += -lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lversion else: CLANG_LIBS += -ldl equals(QMAKE_HOST.os, Darwin): CLANG_LIBS += -lcurses -lm -lxml2 } |