diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2021-05-29 04:13:52 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2021-05-31 11:29:52 +0000 |
commit | ae63b558af0f541d83f69195e730d3007f28e9c4 (patch) | |
tree | e70c580202f4d0b961950a6aa9595756b5a72836 | |
parent | 0ff1cfe032b87b0f2032731c9da35db6a345883f (diff) |
darwin: do not strip debug symbols when dsyms are built-in
We do not need to strip debugging symbols (strip -S) when compiling with
'cpp.separateDebugInformation: false' on Darwin platforms. At least, gcc
does not do that when building non-aggregated products, it only strips
symbols when separate debug info is enabled.
Also, stip symbols from all primary outputs (aka build variants), not
only from the first one (which happens to be "release". This seems to be
correct since we separate debug info from all build variants
Fixes: QBS-1647
Change-Id: I7a0c0883c6b7f74fa4a2c7d4b7bdadc9ee23923a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | share/qbs/modules/cpp/darwin.js | 12 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/share/qbs/modules/cpp/darwin.js b/share/qbs/modules/cpp/darwin.js index 7f7e9a05d..98497a050 100644 --- a/share/qbs/modules/cpp/darwin.js +++ b/share/qbs/modules/cpp/darwin.js @@ -179,17 +179,19 @@ function prepareLipo(project, product, inputs, outputs, input, output) { if (outputs.debuginfo_bundle && outputs.debuginfo_bundle[0]) dsymPath = outputs.debuginfo_bundle[0].filePath; var flags = ModUtils.moduleProperty(product, "dsymutilFlags") || []; + var files = outputs.primary.map(function (f) { return f.filePath; }); cmd = new Command(ModUtils.moduleProperty(product, "dsymutilPath"), flags.concat([ "-o", dsymPath - ]).concat(outputs.primary.map(function (f) { return f.filePath; }))); + ]).concat(files)); cmd.description = "generating dSYM for " + product.name; commands.push(cmd); + + // strip debug info + cmd = new Command(ModUtils.moduleProperty(product, "stripPath"), ["-S"].concat(files)); + cmd.silent = true; + commands.push(cmd); } - cmd = new Command(ModUtils.moduleProperty(product, "stripPath"), - ["-S", outputs.primary[0].filePath]); - cmd.silent = true; - commands.push(cmd); if (outputs.dynamiclibrary_symbols) Array.prototype.push.apply(commands, Gcc.createSymbolCheckingCommands(product, outputs)); diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 775c06a31..aecb69a57 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -1344,6 +1344,7 @@ function prepareLinker(project, product, inputs, outputs, input, output) { cmd.description = "generating dSYM for " + product.name; commands.push(cmd); + // strip debug info cmd = new Command(product.cpp.stripPath, ["-S", primaryOutput.filePath]); cmd.silent = true; |