make compiler invocation error messages mention host/target
it's unclear where to look for the error when the message talks about 'g++' when '${CROSS_COMPILE}g++' would have been expected. help it by saying whether it was supposed to be the host or target compiler. this also centralizes the error emissions in a function. Change-Id: I454c6ff7c0e7dd945dcee0de01e2818caeeb7409 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This commit is contained in:
parent
feb2415363
commit
49cb039a5c
@ -12,6 +12,16 @@ defineReplace(qtMakeExpand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineTest(qtCompilerErrror) {
|
||||||
|
!cross_compile: \
|
||||||
|
what =
|
||||||
|
else: host_build: \
|
||||||
|
what = " host"
|
||||||
|
else: \
|
||||||
|
what = " target"
|
||||||
|
error("Cannot run$$what compiler '$$1'. Maybe you forgot to setup the environment?")
|
||||||
|
}
|
||||||
|
|
||||||
cross_compile:host_build: \
|
cross_compile:host_build: \
|
||||||
target_prefix = QMAKE_HOST_CXX
|
target_prefix = QMAKE_HOST_CXX
|
||||||
else: \
|
else: \
|
||||||
@ -58,8 +68,7 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
cxx_flags += -E -v
|
cxx_flags += -E -v
|
||||||
|
|
||||||
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
|
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
|
||||||
!equals(ec, 0): \
|
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
|
||||||
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
|
|
||||||
|
|
||||||
rim_qcc {
|
rim_qcc {
|
||||||
for (line, output) {
|
for (line, output) {
|
||||||
@ -119,8 +128,7 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
# What's more, -print-search-dirs can't be used on clang on Apple because it
|
# 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).
|
# won't print all the library paths (only the clang-internal ones).
|
||||||
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
|
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
|
||||||
!equals(ec, 0): \
|
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
|
||||||
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
|
|
||||||
|
|
||||||
for (line, output) {
|
for (line, output) {
|
||||||
contains(line, "^libraries: .*") {
|
contains(line, "^libraries: .*") {
|
||||||
@ -162,8 +170,7 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
|
|
||||||
defineReplace(qtVariablesFromMSVC) {
|
defineReplace(qtVariablesFromMSVC) {
|
||||||
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) <NUL 2>NUL", lines, ec)
|
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) <NUL 2>NUL", lines, ec)
|
||||||
!equals(ec, 0): \
|
!equals(ec, 0): qtCompilerErrror($$1)
|
||||||
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
|
|
||||||
return($$ret)
|
return($$ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,8 +178,7 @@ defineReplace(qtVariablesFromGCC) {
|
|||||||
null_device = /dev/null
|
null_device = /dev/null
|
||||||
equals(QMAKE_HOST.os, Windows): null_device = NUL
|
equals(QMAKE_HOST.os, Windows): null_device = NUL
|
||||||
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec)
|
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec)
|
||||||
!equals(ec, 0): \
|
!equals(ec, 0): qtCompilerErrror($$1)
|
||||||
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
|
|
||||||
return($$ret)
|
return($$ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user