summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6WasmMacros.cmake
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2020-09-03 18:29:41 +1000
committerLorn Potter <lorn.potter@gmail.com>2021-04-01 19:23:42 +1000
commit4972fdb350fe79e18b0413e74028cd9b9803f96b (patch)
tree1db1aed90773da8b543576819ea8a156e3748bb2 /src/corelib/Qt6WasmMacros.cmake
parent5bf4133c1752c8d38afaac0064a0726d6036e52c (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 'src/corelib/Qt6WasmMacros.cmake')
-rw-r--r--src/corelib/Qt6WasmMacros.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/corelib/Qt6WasmMacros.cmake b/src/corelib/Qt6WasmMacros.cmake
new file mode 100644
index 0000000000..e9c19160a3
--- /dev/null
+++ b/src/corelib/Qt6WasmMacros.cmake
@@ -0,0 +1,31 @@
+
+function(qt6_wasm_add_target_helpers target)
+ # copy in Qt HTML/JS launch files for apps
+ get_target_property(targetType "${target}" TYPE)
+ if("${targetType}" STREQUAL "EXECUTABLE")
+
+ set(APPNAME ${target})
+
+ if(QT6_INSTALL_PREFIX)
+ set(WASM_BUILD_DIR "${QT6_INSTALL_PREFIX}")
+ elseif(QT_BUILD_DIR)
+ set(WASM_BUILD_DIR "${QT_BUILD_DIR}")
+ endif()
+
+ configure_file("${WASM_BUILD_DIR}/plugins/platforms/wasm_shell.html"
+ "${target}.html")
+ configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtloader.js"
+ qtloader.js COPYONLY)
+ configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtlogo.svg"
+ qtlogo.svg COPYONLY)
+
+ endif()
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_wasm_add_target_helpers)
+ if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
+ qt6_wasm_add_target_helpers(${ARGV})
+ endif()
+ endfunction()
+endif()