aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2020-09-12 15:15:33 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2020-09-24 10:17:07 +0000
commit0d85123b3850f1df07184b018916525bc9a44e97 (patch)
treea70213c36c6b4cfbb7105c37e90f66186d670910 /share
parent739da0f02dcf6542b235ae34b7f44c9f927be98e (diff)
baremetal: Handle cpp.enableDefinesByLanguage for SDCC toolchain
We need to ignore the 'cpp' language because this compiler does not support it. Also if only one 'cpp' language specified, we need to return false for the 'found' property of a probe. Change-Id: Ic9f8b3e1ce06dde55b5a9bdc5c1018e039316cd7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/imports/qbs/Probes/SdccProbe.qbs18
-rw-r--r--share/qbs/modules/cpp/sdcc.qbs1
2 files changed, 17 insertions, 2 deletions
diff --git a/share/qbs/imports/qbs/Probes/SdccProbe.qbs b/share/qbs/imports/qbs/Probes/SdccProbe.qbs
index 6f76b4919..ae616fa27 100644
--- a/share/qbs/imports/qbs/Probes/SdccProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/SdccProbe.qbs
@@ -34,6 +34,7 @@ import "../../../modules/cpp/sdcc.js" as SDCC
PathProbe {
// Inputs
property string compilerFilePath
+ property stringList enableDefinesByLanguage
property string preferredArchitecture
// Outputs
@@ -53,9 +54,22 @@ PathProbe {
return;
}
+ var languages = enableDefinesByLanguage;
+ if (!languages || languages.length === 0)
+ languages = ["c"];
+
+ // SDCC compiler support only the C-language.
+ if (!languages.contains("c")) {
+ found = false;
+ return;
+ }
+
var macros = SDCC.dumpMacros(compilerFilePath, preferredArchitecture);
+ if (!macros) {
+ found = false;
+ return;
+ }
- // SDCC it is only the C language compiler.
compilerDefinesByLanguage["c"] = macros;
architecture = SDCC.guessArchitecture(macros);
@@ -69,7 +83,7 @@ PathProbe {
versionMajor = version.major;
versionMinor = version.minor;
versionPatch = version.patch;
- found = true;
+ found = !!architecture && !!endianness;
}
}
}
diff --git a/share/qbs/modules/cpp/sdcc.qbs b/share/qbs/modules/cpp/sdcc.qbs
index 3c5be7cdd..da1b89402 100644
--- a/share/qbs/modules/cpp/sdcc.qbs
+++ b/share/qbs/modules/cpp/sdcc.qbs
@@ -48,6 +48,7 @@ CppModule {
id: sdccProbe
condition: !_skipAllChecks
compilerFilePath: compilerPath
+ enableDefinesByLanguage: enableCompilerDefinesByLanguage
preferredArchitecture: qbs.architecture
}