summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2021-04-26 11:00:39 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-04-27 12:12:35 +0000
commitf6c8798001bbf647ccd4b52d9d520f117615be23 (patch)
tree28986b5bc7ca13bcfa3178c31616ce81ba38024a /mkspecs
parentf3719c66f46e1bdda49a108e61c35cb0c0182f09 (diff)
WASM: Don’t set “-g4” by default for qmake builds
This increases link time significantly; instead set "-g4" or the new "-gsource-map" only if source maps are enabled. Change-Id: Ibe2d438d48e9ae2fce5f79d4e8a9f17c01cf2485 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/wasm/wasm.prf24
1 files changed, 18 insertions, 6 deletions
diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf
index 882d2e49c8..5ffc647135 100644
--- a/mkspecs/features/wasm/wasm.prf
+++ b/mkspecs/features/wasm/wasm.prf
@@ -114,12 +114,24 @@ contains(TEMPLATE, .*app) {
qtConfTest_emccVersion()
-# Pass --source-map-base on the linker line. This informs the
-# browser where to find the source files when debugging.
-WASM_SOURCE_MAP_BASE = http://localhost:8000/
-!isEmpty(QT_WASM_SOURCE_MAP_BASE):\
- WASM_SOURCE_MAP_BASE = $$QT_WASM_SOURCE_MAP_BASE
-CONFIG(debug): QMAKE_LFLAGS += -g4 --source-map-base $$WASM_SOURCE_MAP_BASE
+CONFIG(debug):!isEmpty(QT_WASM_SOURCE_MAP) {
+
+ EMCC_VERSION = $$qtSystemEmccVersion()
+
+ greaterThan(EMCC_VERSION, 2.0.16) {
+ # emsdk 2.0.17 depreciates use of -g4
+ QMAKE_LFLAGS += -gsource-map
+ } else {
+ QMAKE_LFLAGS += -g4
+ }
+ # Pass --source-map-base on the linker line. This informs the
+ # browser where to find the source files when debugging.
+ WASM_SOURCE_MAP_BASE = http://localhost:8000/
+ !isEmpty(QT_WASM_SOURCE_MAP_BASE):\
+ WASM_SOURCE_MAP_BASE = $$QT_WASM_SOURCE_MAP_BASE
+ QMAKE_LFLAGS += --source-map-base $$WASM_SOURCE_MAP_BASE
+}
+
# Creates the stand-alone version of the library from bitcode
!static:contains(TEMPLATE, .*lib): {