diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-03-31 10:34:19 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-04-01 16:16:31 +0000 |
commit | e0266ffc85058d371e18b0ae8ea49585697ceb59 (patch) | |
tree | 2b86c248104951d3b36f4061783899167c8152c3 /share | |
parent | fd1a0ce5b0bd23bb2121e896c1c2732c3d41884a (diff) |
Share cpp::linkerMapSuffix property
It makes sense to add the cpp.linkerMapSuffix property to the base
CppModule due the following reasons:
1. It is possible that the user wants to change the extension for
the generated map files, which makes working with Qbs more flexible.
2. It will be easier to write an autotests that check the generation
of the map files for a bare metal platforms, where object files can
have various extensions such as ".map", ".m51", ".m66", and so forth.
Change-Id: I1e5e3b39bf84fddfe8c06f2db9d3936c6a3ff027
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 1 | ||||
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/keil.js | 4 | ||||
-rw-r--r-- | share/qbs/modules/cpp/keil.qbs | 3 | ||||
-rw-r--r-- | share/qbs/modules/cpp/sdcc.js | 4 | ||||
-rw-r--r-- | share/qbs/modules/cpp/windows-msvc-base.qbs | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 61c9c3f65..761e8be85 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -187,6 +187,7 @@ Module { property string variantSuffix: "" property string dynamicLibraryImportSuffix: ".lib" property string objectSuffix: ".o" + property string linkerMapSuffix: ".map" property bool createSymlinks: true property stringList dynamicLibraries // list of names, will be linked with -lname property stringList staticLibraries // list of static library files diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index e2d9eeab5..934636849 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -578,7 +578,7 @@ CppModule { if (product.cpp.generateLinkerMapFile) { artifacts.push({ filePath: FileInfo.joinPaths(product.destinationDirectory, - product.targetName + ".map"), + product.targetName + product.cpp.linkerMapSuffix), fileTags: ["mem_map"] }); } diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 5e5f1293f..a1f1a9a88 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -640,7 +640,7 @@ function applicationLinkerOutputArtifacts(product) { fileTags: ["mem_map"], filePath: FileInfo.joinPaths( product.destinationDirectory, - product.targetName + ".map") + product.targetName + product.cpp.linkerMapSuffix) }; return [app, mem_map] } diff --git a/share/qbs/modules/cpp/keil.js b/share/qbs/modules/cpp/keil.js index 0e8560421..567b0ddd3 100644 --- a/share/qbs/modules/cpp/keil.js +++ b/share/qbs/modules/cpp/keil.js @@ -168,7 +168,7 @@ function objectSuffix(qbs) { + architecture + "'"; } -function mapFileSuffix(qbs) { +function linkerMapSuffix(qbs) { var architecture = qbs.architecture; if (isMcs51Architecture(architecture)) return ".m51"; @@ -611,7 +611,7 @@ function applicationLinkerOutputArtifacts(product) { fileTags: ["mem_map"], filePath: FileInfo.joinPaths( product.destinationDirectory, - product.targetName + product.cpp.mapFileSuffix) + product.targetName + product.cpp.linkerMapSuffix) }; return [app, mem_map]; } diff --git a/share/qbs/modules/cpp/keil.qbs b/share/qbs/modules/cpp/keil.qbs index aa4eaadf9..f1f3b50e8 100644 --- a/share/qbs/modules/cpp/keil.qbs +++ b/share/qbs/modules/cpp/keil.qbs @@ -90,8 +90,7 @@ CppModule { staticLibrarySuffix: KEIL.staticLibrarySuffix(qbs) executableSuffix: KEIL.executableSuffix(qbs) objectSuffix: KEIL.objectSuffix(qbs) - - property string mapFileSuffix: KEIL.mapFileSuffix(qbs) + linkerMapSuffix: KEIL.linkerMapSuffix(qbs) imageFormat: KEIL.imageFormat(qbs) diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js index 71ed22ffa..a47063401 100644 --- a/share/qbs/modules/cpp/sdcc.js +++ b/share/qbs/modules/cpp/sdcc.js @@ -303,7 +303,7 @@ function applicationLinkerOutputArtifacts(product) { fileTags: ["mem_map"], filePath: FileInfo.joinPaths( product.destinationDirectory, - product.targetName + ".map") + product.targetName + product.cpp.linkerMapSuffix) }; return [app, lk_cmd, mem_summary, mem_map] } @@ -651,7 +651,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) { cmd = new JavaScriptCommand(); cmd.mapFilePath = FileInfo.joinPaths( FileInfo.path(target.filePath), - FileInfo.completeBaseName(target.fileName) + ".map"); + FileInfo.completeBaseName(target.fileName) + product.cpp.linkerMapSuffix); cmd.silent = true; cmd.sourceCode = function() { File.remove(mapFilePath); }; cmds.push(cmd); diff --git a/share/qbs/modules/cpp/windows-msvc-base.qbs b/share/qbs/modules/cpp/windows-msvc-base.qbs index 97ba7c64f..b25fdf159 100644 --- a/share/qbs/modules/cpp/windows-msvc-base.qbs +++ b/share/qbs/modules/cpp/windows-msvc-base.qbs @@ -210,7 +210,7 @@ CppModule { fileTags: ["mem_map"], filePath: FileInfo.joinPaths( product.destinationDirectory, - product.targetName + ".map") + product.targetName + product.cpp.linkerMapSuffix) }); } return artifacts; |