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>
bb10
Morten Sørvig 2021-04-26 11:00:39 +02:00 committed by Morten Johan Sørvig
parent f3719c66f4
commit f6c8798001
1 changed files with 18 additions and 6 deletions

View File

@ -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): {