aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/sdcc.js
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2021-04-05 12:14:34 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2021-04-06 06:22:29 +0000
commit44ef034472337abdb894f76f593da6648f9782d5 (patch)
tree440340ba986966f55d5631abeaf6254cdd3ab772 /share/qbs/modules/cpp/sdcc.js
parentef7b698b74b4f77b2dd8135ff8f4451aca727763 (diff)
Share cpp::{assembler|compiler}ListingSuffix properties
It makes sense to add the cpp.assemblerListingSuffix and the cpp.compilerListingSuffix properties to the base CppModule due the following reasons: 1. It is possible that the user wants to change the extension for the generated listing files, which makes working with Qbs more flexible. 2. It will be easier to write an autotests that check the generation of the listing files for a bare metal platforms, where listing files can have various extensions such as ".lst", ".ls", and so forth. Change-Id: I9989288bff0659dd3e8b7a443d0354bb78475270 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/cpp/sdcc.js')
-rw-r--r--share/qbs/modules/cpp/sdcc.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js
index 4010e38db..ca085a421 100644
--- a/share/qbs/modules/cpp/sdcc.js
+++ b/share/qbs/modules/cpp/sdcc.js
@@ -239,7 +239,7 @@ function collectLibraryDependencies(product) {
return result;
}
-function compilerOutputArtifacts(input, useListing) {
+function compilerOutputArtifacts(input, isCompilerArtifacts) {
var obj = {
fileTags: ["obj"],
filePath: Utilities.getHash(input.baseDir) + "/"
@@ -270,11 +270,17 @@ function compilerOutputArtifacts(input, useListing) {
+ input.fileName + ".rst"
};
var artifacts = [obj, asm_adb, asm_src, asm_sym, rst_data];
- if (useListing) {
+ if (isCompilerArtifacts && input.cpp.generateCompilerListingFiles) {
artifacts.push({
fileTags: ["lst"],
filePath: Utilities.getHash(input.baseDir) + "/"
- + input.fileName + ".lst"
+ + input.fileName + input.cpp.compilerListingSuffix
+ });
+ } else if (!isCompilerArtifacts && input.cpp.generateAssemblerListingFiles) {
+ artifacts.push({
+ fileTags: ["lst"],
+ filePath: Utilities.getHash(input.baseDir) + "/"
+ + input.fileName + input.cpp.assemblerListingSuffix
});
}
return artifacts;
@@ -628,6 +634,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) {
cmd = new JavaScriptCommand();
cmd.objectPaths = inputs.obj.map(function(a) { return a.filePath; });
cmd.objectSuffix = product.cpp.objectSuffix;
+ cmd.listingSuffix = product.cpp.compilerListingSuffix
cmd.silent = true;
cmd.sourceCode = function() {
objectPaths.forEach(function(objectPath) {
@@ -635,7 +642,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) {
return; // Skip the assembler objects.
var listingPath = FileInfo.joinPaths(
FileInfo.path(objectPath),
- FileInfo.completeBaseName(objectPath) + ".lst");
+ FileInfo.completeBaseName(objectPath) + listingSuffix);
File.remove(listingPath);
});
};