diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-01-16 14:41:28 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-07-29 17:23:16 +0200 |
commit | c2f041203f8cd8fec50e716872608ba1835243f7 (patch) | |
tree | 82208204e337475cb1f524edce8b0ce4361df602 | |
parent | 080fbb55b5a4c78a24a1411ae2925d03add3cd17 (diff) |
qmake: Keep -force_load with library when merging linker flags
Without treating -force_load as an option with an argument, we end up
leaving stray -force_loads in the linker line, resulting in build
failures when the following option is a random library then treated
as a file path.
Task-number: QTBUG-66091
Change-Id: I352c50ab67e32ef6b2b5c6a4f90455b20034e207
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 3b6e87a2b6..d7c9413290 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -498,17 +498,20 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) // Make sure we keep the dependency order of libraries lflags[arch].removeAll(opt); lflags[arch].append(opt); - } else if (target_mode == TARG_MAC_MODE && opt == "-framework") { + } else if (target_mode == TARG_MAC_MODE + && (opt == "-framework" || opt == "-force_load")) { + // Handle space separated options + ProString dashOpt = opt; opt = l.at(++lit); if (opt.startsWith("-Xarch")) opt = l.at(++lit); // The user has done the right thing and prefixed each part for(int x = 0; x < lflags[arch].size(); ++x) { - if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) { + if (lflags[arch].at(x) == dashOpt && lflags[arch].at(++x) == opt) { lflags[arch].remove(x - 1, 2); break; } } - lflags[arch].append("-framework"); + lflags[arch].append(dashOpt); lflags[arch].append(opt); } else { lflags[arch].append(opt); |