diff options
Diffstat (limited to 'src/plugins/qbsprojectmanager')
-rw-r--r-- | src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 16 | ||||
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsproject.cpp | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 2f6aa13e88..9f0b648dc6 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -67,14 +67,14 @@ static QString extractToolchainPrefix(QString *compilerName) QString prefix; const QStringList candidates = {QLatin1String("g++"), QLatin1String("clang++"), QLatin1String("gcc"), QLatin1String("clang")}; - foreach (const QString &candidate, candidates) { - const QString suffix = Utils::HostOsInfo::withExecutableSuffix(QLatin1Char('-') - + candidate); - if (compilerName->endsWith(suffix)) { - const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1; - prefix = compilerName->left(idx); - compilerName->remove(0, idx); - } + for (const QString &candidate : candidates) { + const QString suffix = QLatin1Char('-') + candidate; + const int suffixIndex = compilerName->lastIndexOf(suffix); + if (suffixIndex == -1) + continue; + prefix = compilerName->left(suffixIndex + 1); + compilerName->remove(0, suffixIndex + 1); + break; } return prefix; } diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index e7d4f27fac..f6c58a2bb1 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -915,6 +915,7 @@ static RawProjectParts generateProjectParts( rpp.setBuildTargetType(prd.value("is-runnable").toBool() ? BuildTargetType::Executable : BuildTargetType::Library); + rpp.setSelectedForBuilding(grp.value("is-enabled").toBool()); QHash<QString, QJsonObject> filePathToSourceArtifact; bool hasCFiles = false; |