diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-05-04 16:49:38 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-05-06 10:18:11 +0000 |
commit | 8b4ea1276558e65109982339d3ae65a143e2360d (patch) | |
tree | ce18aa59d60a34f01b990673a19f55c56b0eac82 /share/qbs/modules/cpp/iar.js | |
parent | 614e7381255bc48a494df45f09015c0ad9a7453f (diff) | |
download | qbs-8b4ea1276558e65109982339d3ae65a143e2360d.tar.gz |
Fix conditionally generation for some artifacts and tags
We need to generate a list of file tags and artifacts taking
into account the dependent properties from the product.
For example, we should only build tags for generating linker
files if the generateLinkerMapFile property has been set.
Change-Id: I286c566ffe119eebf24b60113dda65403f7af3dd
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/iar.js')
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 416de7ee2..47158a209 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -612,6 +612,20 @@ function collectLibraryDependencies(product) { return result; } +function compilerOutputTags(needsListingFiles) { + var tags = ["obj"]; + if (needsListingFiles) + tags.push("lst"); + return tags; +} + +function applicationLinkerOutputTags(needsLinkerMapFile) { + var tags = ["application"]; + if (needsLinkerMapFile) + tags.push("mem_map"); + return tags; +} + function compilerOutputArtifacts(input, isCompilerArtifacts) { var artifacts = []; artifacts.push({ @@ -636,19 +650,21 @@ function compilerOutputArtifacts(input, isCompilerArtifacts) { } function applicationLinkerOutputArtifacts(product) { - var app = { + var artifacts = [{ fileTags: ["application"], filePath: FileInfo.joinPaths( - product.destinationDirectory, - PathTools.applicationFilePath(product)) - }; - var mem_map = { - fileTags: ["mem_map"], - filePath: FileInfo.joinPaths( - product.destinationDirectory, - product.targetName + product.cpp.linkerMapSuffix) - }; - return [app, mem_map] + product.destinationDirectory, + PathTools.applicationFilePath(product)) + }]; + if (product.cpp.generateLinkerMapFile) { + artifacts.push({ + fileTags: ["mem_map"], + filePath: FileInfo.joinPaths( + product.destinationDirectory, + product.targetName + product.cpp.linkerMapSuffix) + }); + } + return artifacts; } function staticLibraryLinkerOutputArtifacts(product) { |