Merge remote-tracking branch 'origin/7.0'

Change-Id: I9a7a9a5579f1f4e277e7927eefb1bab9ca60ad4a
This commit is contained in:
Eike Ziller
2022-04-07 09:51:40 +02:00
23 changed files with 168 additions and 41 deletions

View File

@@ -268,7 +268,18 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input,
// CMake sometimes mixes several shell-escaped pieces into one fragment. Disentangle that again:
const QStringList parts = ProcessArgs::splitArgs(f.fragment);
for (const QString &part : parts) {
for (QString part : parts) {
// Library search paths that are added with target_link_directories are added as
// -LIBPATH:... (Windows/MSVC), or
// -L... (Unix/GCC)
// with role "libraryPath"
if (f.role == "libraryPath") {
if (part.startsWith("-LIBPATH:"))
part = part.mid(9);
else if (part.startsWith("-L"))
part = part.mid(2);
}
// Some projects abuse linking to libraries to pass random flags to the linker, so ignore
// flags mixed into a fragment
if (part.startsWith("-"))