From 3ad7ef479612a8a0c3ca401e692ef47cfeef01fc Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Mon, 16 Mar 2020 17:35:15 +0300 Subject: QbsPM: Fix wrong {GCC|Clang} compiler name and prefix handling When the GCC or Clang compiler name ends with the version sub-string (f.e. arm-none-eabi-gcc-8.2.1.exe), this leads to the wrong cCompilerName detection, that causes the project parsing errors and disables the project: The following properties are not set. Set them in your profile or product: cpp.compilerIncludePaths cpp.compilerFrameworkPaths cpp.compilerLibraryPaths Product 'xyz' had errors and was disabled. Now we return a proper prefix (e.g. arm-none-eabi-) and cCompilerName with a version (e.g. 'gcc-8.2.1.exe') Change-Id: I5dd42a343a0982326ed0f23b821e5016b8df39f1 Reviewed-by: Christian Kandeler --- .../qbsprojectmanager/defaultpropertyprovider.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/plugins/qbsprojectmanager') diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index f930d1d7af..4f373b8ee3 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -65,14 +65,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; } -- cgit v1.2.3 From 4fefbbcb66564ae87a673e6b3c506f5a21e03fee Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 18 Mar 2020 09:29:10 +0100 Subject: QbsPM: Pass enabled information to code model If a project part is not enabled let the code model know about it as others may refer to this information as well. Fixes an issue with the AutoTest plugin when it tries to run a test for which no build targets will be generated at all as it is disabled by some condition. Change-Id: I342e8dde0a171084894ec59fdb462d7e9526c8db Reviewed-by: Christian Kandeler --- src/plugins/qbsprojectmanager/qbsproject.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/qbsprojectmanager') diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 08e65445cb..ed9488f7eb 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -919,6 +919,7 @@ static RawProjectParts generateProjectParts( rpp.setBuildTargetType(prd.value("is-runnable").toBool() ? BuildTargetType::Executable : BuildTargetType::Library); + rpp.setSelectedForBuilding(grp.value("is-enabled").toBool()); QHash filePathToSourceArtifact; bool hasCFiles = false; -- cgit v1.2.3