summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:34:32 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:36:10 -0700
commitd38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch)
treee5c92cef74e0853490d77cf0139b23f00d548a6e /mkspecs
parentac4e848c9802377b7c4ff673180f28b9ca76b746 (diff)
parent627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/gcc-base.conf2
-rw-r--r--mkspecs/features/toolchain.prf24
2 files changed, 23 insertions, 3 deletions
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index b63f96524b..234f71d495 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
@@ -36,7 +36,7 @@ QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Og
QMAKE_CFLAGS_OPTIMIZE_SIZE = -Os
-QMAKE_CFLAGS += -pipe
+!equals(QMAKE_HOST.os, Windows): QMAKE_CFLAGS += -pipe
QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON += -Wall -W
QMAKE_CFLAGS_WARN_OFF += -w
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index eb7b1385f2..813dbffbd4 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -50,11 +50,11 @@ isEmpty($${target_prefix}.INCDIRS) {
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: \
+ else: darwin:clang: \
# Need to link to pick up library paths
cxx_flags += $$QMAKE_LFLAGS_SHLIB -o /dev/null -v -Wl,-v
else: \
- # gcc is fine with just preprocessing
+ # Just preprocess, might not pick up library paths
cxx_flags += -E -v
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
@@ -111,6 +111,26 @@ isEmpty($${target_prefix}.INCDIRS) {
}
}
}
+ !darwin:clang {
+ # Clang on a non-Apple system (that is, a system without ld64 -- say, with GNU ld
+ # or gold under Linux) will not print any library search path. Need to use another
+ # invocation with different options (which in turn doesn't print include search
+ # paths, so it can't just be used in place of the above code).
+ # 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): \
+ error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
+
+ for (line, output) {
+ contains(line, "^libraries: .*") {
+ line ~= s,^libraries: ,,
+ paths = $$split(line, $$QMAKE_DIRLIST_SEP)
+ for (path, paths): \
+ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$replace(path, ^=, $$[SYSROOT]))
+ }
+ }
+ }
isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \
!integrity: \
error("failed to parse default search paths from compiler output")