summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-01 13:04:06 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-14 18:05:53 +0000
commitfb326ae1268aa5e5fd0c9369ccbe30fe5d6d8b62 (patch)
tree6bd345fc89cf10fca5f83d80a18566e3610b8b03
parente291f6774339ada7a495b24664c4906d46233272 (diff)
qmake: print compiler output if detection phase fails
helps enormously with debugging. Change-Id: Ic8876e74a4dbb14006d8b48658eb141a3f0e0fbf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--mkspecs/features/toolchain.prf16
1 files changed, 11 insertions, 5 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index ba41598be1..eb592badf4 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -19,7 +19,13 @@ defineTest(qtCompilerErrror) {
what = " host"
else: \
what = " target"
- error("Cannot run$$what compiler '$$1'. Maybe you forgot to setup the environment?")
+ msg = \
+ "Cannot run$$what compiler '$$1'. Output:" \
+ "===================" \
+ $$2 \
+ "===================" \
+ "Maybe you forgot to setup the environment?"
+ error($$join(msg, $$escape_expand(\\n)))
}
cross_compile:host_build: \
@@ -64,7 +70,7 @@ isEmpty($${target_prefix}.INCDIRS) {
cxx_flags += -E -v
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
+ !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
rim_qcc {
for (line, output) {
@@ -124,7 +130,7 @@ isEmpty($${target_prefix}.INCDIRS) {
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
+ !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
for (line, output) {
contains(line, "^libraries: .*") {
@@ -166,14 +172,14 @@ isEmpty($${target_prefix}.INCDIRS) {
defineReplace(qtVariablesFromMSVC) {
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) <NUL 2>NUL", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$1)
+ !equals(ec, 0): qtCompilerErrror($$1, $$ret)
return($$ret)
}
defineReplace(qtVariablesFromGCC) {
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
<$$QMAKE_SYSTEM_NULL_DEVICE 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
- !equals(ec, 0): qtCompilerErrror($$1)
+ !equals(ec, 0): qtCompilerErrror($$1, $$ret)
return($$ret)
}