diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2020-09-03 18:29:41 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2021-04-01 19:23:42 +1000 |
commit | 4972fdb350fe79e18b0413e74028cd9b9803f96b (patch) | |
tree | 1db1aed90773da8b543576819ea8a156e3748bb2 /mkspecs/features | |
parent | 5bf4133c1752c8d38afaac0064a0726d6036e52c (diff) |
wasm: add cmake build support
A few configure defines get changed:
QMAKE_WASM_PTHREAD_POOL_SIZE is now QT_WASM_PTHREAD_POOL_SIZE
QMAKE_WASM_TOTAL_MEMORY is now QT_WASM_INITIAL_MEMORY
QMAKE_WASM_SOURCE_MAP_BASE is now QT_WASM_SOURCE_MAP_BASE
device-option EMSCRIPTEN_ASYNCIFY=1 is QT_EMSCRIPTEN_ASYNCIFY=1
To create source maps for debugging. use
device-option QT_WASM_SOURCE_MAP=1
Task-number: QTBUG-78647
Change-Id: If9f30cd7fb408c386d6d69b5f7b1beecf1ab44b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/wasm/wasm.prf | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf index 2e886fc4a5..882d2e49c8 100644 --- a/mkspecs/features/wasm/wasm.prf +++ b/mkspecs/features/wasm/wasm.prf @@ -13,8 +13,8 @@ exists($$QMAKE_QT_CONFIG) { # Create worker threads at startup. This is supposed to be an optimization, # however exceeding the pool size has been obesverved to hang the application. POOL_SIZE = 4 - !isEmpty(QMAKE_WASM_PTHREAD_POOL_SIZE) { - POOL_SIZE = $$QMAKE_WASM_PTHREAD_POOL_SIZE + !isEmpty(QT_WASM_PTHREAD_POOL_SIZE) { + POOL_SIZE = $$QT_WASM_PTHREAD_POOL_SIZE } message("Setting PTHREAD_POOL_SIZE to" $$POOL_SIZE) @@ -23,18 +23,18 @@ exists($$QMAKE_QT_CONFIG) { EMCC_THREAD_LFLAGS += -s ALLOW_MEMORY_GROWTH=1 } - qtConfig(thread) | !isEmpty(QMAKE_WASM_TOTAL_MEMORY) { + qtConfig(thread) | !isEmpty(QT_WASM_INITIAL_MEMORY) { # Hardcode wasm memory size. Emscripten does not currently support memory growth # (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size # at build time. Further, browsers limit the maximum initial memory size to 1GB. - # QMAKE_WASM_TOTAL_MEMORY must be a multiple of 64KB - TOTAL_MEMORY = 1GB - !isEmpty(QMAKE_WASM_TOTAL_MEMORY) { - TOTAL_MEMORY = $$QMAKE_WASM_TOTAL_MEMORY + # QT_WASM_INITIAL_MEMORY must be a multiple of 64KB + INITIAL_MEMORY = 1GB + !isEmpty(QT_WASM_INITIAL_MEMORY) { + INITIAL_MEMORY = $$QT_WASM_INITIAL_MEMORY } - message("Setting TOTAL_MEMORY to" $$TOTAL_MEMORY) - EMCC_THREAD_LFLAGS += -s TOTAL_MEMORY=$$TOTAL_MEMORY + message("Setting INITIAL_MEMORY to" $$INITIAL_MEMORY) + EMCC_THREAD_LFLAGS += -s INITIAL_MEMORY=$$INITIAL_MEMORY } QMAKE_LFLAGS += $$EMCC_THREAD_LFLAGS QMAKE_LFLAGS_DEBUG += $$EMCC_THREAD_LFLAGS @@ -117,9 +117,9 @@ 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(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 +!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 # Creates the stand-alone version of the library from bitcode !static:contains(TEMPLATE, .*lib): { |