Wasm: enable source map support for debug builds

The source map location can be configured by setting
QMAKE_WASM_SOURCE_MAP_BASE in the .pro file. Fall back
to “http://localhost:8000” if not set.

Task-number: QTBUG-72002
Change-Id: I9da80dacdefc272f267e5db4caac274d93ba4479
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Morten Johan Sørvig 2018-11-27 22:02:07 +01:00
parent 60addee938
commit 6e7a7d5fb9

View File

@ -72,6 +72,13 @@ contains(TEMPLATE, .*app) {
} }
} }
# 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(QMAKE_WASM_SOURCE_MAP_BASE):\
WASM_SOURCE_MAP_BASE = $$QMAKE_WASM_SOURCE_MAP_BASE
CONFIG(debug): QMAKE_LFLAGS += --source-map-base $$WASM_SOURCE_MAP_BASE
# Creates the stand-alone version of the library from bitcode # Creates the stand-alone version of the library from bitcode
!static:contains(TEMPLATE, .*lib): { !static:contains(TEMPLATE, .*lib): {
load(resolve_target) load(resolve_target)