From 76223ecbaa3b01a9c2ab641bd30d674f7c46a4d6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 8 Jun 2017 14:39:05 +0200 Subject: complain when toolchain.prf fails to run the compiler Task-number: QTBUG-60059 Change-Id: I2babe8aaf7cdf5912686f679d14bebc82231a846 Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mkspecs/features/toolchain.prf') diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 6cab503b0f..34bd8f1d78 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -47,7 +47,9 @@ isEmpty($${target_prefix}.INCDIRS) { # gcc is fine with just preprocessing cxx_flags += -E -v - output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines) + output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?") add_includes = false add_libraries = false for (line, output) { @@ -102,13 +104,19 @@ isEmpty($${target_prefix}.INCDIRS) { # defineReplace(qtVariablesFromMSVC) { - return($$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) NUL", lines)) + ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) NUL", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?") + return($$ret) } defineReplace(qtVariablesFromGCC) { null_device = /dev/null equals(QMAKE_HOST.os, Windows): null_device = NUL - return($$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines)) + ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec) + !equals(ec, 0): \ + error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?") + return($$ret) } isEmpty($${target_prefix}.COMPILER_MACROS) { -- cgit v1.2.3