summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-10-16 15:08:49 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-10-21 11:10:44 +0000
commit02af2595540e7666b6aad1991599763230af339d (patch)
treeca3471bc3d99e1aeadb7aba051d2b1d87b68384f
parent6fa5e8cb9864d21ee29ab4e25bf64b8d3672cbdf (diff)
Allow to generate map file using MSVC toolchain
Right now it is possible to generate a linker map file using the cpp.generateLinkerMapFile property. Change-Id: Iffed6867e9829f5f2ca51b1932d6641963e66abe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/modules/cpp/msvc.js3
-rw-r--r--share/qbs/modules/cpp/windows-msvc-base.qbs10
2 files changed, 12 insertions, 1 deletions
diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js
index 02facf30a..b67ab811f 100644
--- a/share/qbs/modules/cpp/msvc.js
+++ b/share/qbs/modules/cpp/msvc.js
@@ -470,6 +470,9 @@ function prepareLinker(project, product, inputs, outputs, input, output) {
if (product.cpp.entryPoint)
args.push("/ENTRY:" + product.cpp.entryPoint);
+ if (outputs.application && product.cpp.generateLinkerMapFile)
+ args.push("/MAP:" + outputs.mem_map[0].filePath);
+
args.push('/OUT:' + linkerOutputNativeFilePath)
var libraryPaths = product.cpp.libraryPaths;
if (libraryPaths)
diff --git a/share/qbs/modules/cpp/windows-msvc-base.qbs b/share/qbs/modules/cpp/windows-msvc-base.qbs
index ae105abe2..aa1c8256c 100644
--- a/share/qbs/modules/cpp/windows-msvc-base.qbs
+++ b/share/qbs/modules/cpp/windows-msvc-base.qbs
@@ -176,7 +176,7 @@ CppModule {
inputs: ['obj', 'native.pe.manifest']
inputsFromDependencies: ['staticlibrary', 'dynamiclibrary_import', "debuginfo_app"]
- outputFileTags: ["application", "debuginfo_app"]
+ outputFileTags: ["application", "debuginfo_app", "mem_map"]
outputArtifacts: {
var app = {
fileTags: ["application"],
@@ -192,6 +192,14 @@ CppModule {
+ product.cpp.debugInfoSuffix
});
}
+ if (product.cpp.generateLinkerMapFile) {
+ artifacts.push({
+ fileTags: ["mem_map"],
+ filePath: FileInfo.joinPaths(
+ product.destinationDirectory,
+ product.targetName + ".map")
+ });
+ }
return artifacts;
}