Add query of default include/library paths for QNX

Change-Id: Iafc5a573a2ddb277d2a786cb6b48521985defe44
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
James McDonnell 2017-06-06 15:34:56 -04:00
parent 6dd61b4e62
commit b2ec7317c8

View File

@ -25,9 +25,11 @@ isEmpty($${target_prefix}.INCDIRS) {
!equals(QMAKE_HOST.os, Windows) {
cmd_prefix = "LC_ALL=C"
cmd_suffix = "</dev/null >/dev/null"
null_file = /dev/null
} else {
cmd_prefix = "set LC_ALL=C&"
cmd_suffix = "<NUL >NUL"
null_file = NUL
}
cxx_flags = $$QMAKE_CXXFLAGS
@ -40,7 +42,10 @@ isEmpty($${target_prefix}.INCDIRS) {
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin: cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH
clang: \
rim_qcc: \
# Need the cc1plus and ld command lines to pick up the paths
cxx_flags += $$QMAKE_LFLAGS_SHLIB -o $$null_file -v
else: clang: \
# Need to link to pick up library paths
cxx_flags += $$QMAKE_LFLAGS_SHLIB -o /dev/null -v -Wl,-v
else: \
@ -50,6 +55,29 @@ isEmpty($${target_prefix}.INCDIRS) {
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?")
rim_qcc {
for (line, output) {
contains(line, "^[^ ]*cc1plus .*") {
take_next = false
for (parameter, $$list($$line)) {
$$take_next {
QMAKE_DEFAULT_INCDIRS += $$clean_path($$parameter)
take_next = false
} else: equals(parameter, "-isystem") {
take_next = true
}
}
} else: contains(line, "^[^ ]*-ld .*") {
for (parameter, $$list($$line)) {
contains(parameter, "^-L.*") {
parameter ~= s/^-L//
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$parameter)
}
}
}
}
} else {
add_includes = false
add_libraries = false
for (line, output) {
@ -77,8 +105,9 @@ isEmpty($${target_prefix}.INCDIRS) {
QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
}
}
}
isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \
!if(qnx|integrity): \
!integrity: \
error("failed to parse default search paths from compiler output")
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
} else: msvc {