summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-09-11 17:01:52 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-15 12:43:20 +0000
commit2285f41477986a56707144b786c60d0d41e2a242 (patch)
tree5cfb3afecf7a9405817ddd3767def7bd971d168b
parent2e90c5fc6568e5602743502b13d8d69c0e3accbc (diff)
qmake: Don't error out if QMAKE_DEFAULT_LIBDIRS is empty on macOS
The new linker in Xcode 15 doesn't provide any default linker or framework paths when requested via -v, but still seems to use the default paths documented in the ld man page. We trust that linker will do the right thing, even if we don't know of its default linker paths. We also need to opt out of the default fallback logic to set the libdirs to /lib and /usr/lib. This may result in UnixMakefileGenerator::findLibraries finding different libraries than expected, if additional paths are passed with -L, which will then take precedence for qmake, even if the linker itself will use the library from the SDK's default paths. This should hopefully not be an issue in practice, as we don't turn -lFoo into absolute paths in qmake, so the only risk is that we're picking up the wrong prl files and adding additional dependencies that the lib in the SDK doesn't have. Change-Id: I2347b26e2df0828471373b0e15b8c9089274c65d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit cdf64b0e47115cc473e1afd1472b4b09e130b2a5) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ee6ff2604779090745642f3a5a28bfba8bd9c350) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--mkspecs/features/toolchain.prf9
1 files changed, 6 insertions, 3 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 0040b6c4b9..bfad10d35b 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -288,9 +288,12 @@ isEmpty($${target_prefix}.INCDIRS) {
}
}
}
- isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \
+ isEmpty(QMAKE_DEFAULT_INCDIRS): \
!integrity: \
- error("failed to parse default search paths from compiler output")
+ error("failed to parse default include paths from compiler output")
+ isEmpty(QMAKE_DEFAULT_LIBDIRS): \
+ !integrity:!darwin: \
+ error("failed to parse default library paths from compiler output")
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
} else: ghs {
cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp
@@ -411,7 +414,7 @@ isEmpty($${target_prefix}.INCDIRS) {
QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP)
}
- unix:if(!cross_compile|host_build) {
+ unix:!darwin:if(!cross_compile|host_build) {
isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include
isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib
}