summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/wasm')
-rw-r--r--mkspecs/features/wasm/default_pre.prf2
-rw-r--r--mkspecs/features/wasm/emcc_ver.prf23
-rw-r--r--mkspecs/features/wasm/wasm.prf7
3 files changed, 31 insertions, 1 deletions
diff --git a/mkspecs/features/wasm/default_pre.prf b/mkspecs/features/wasm/default_pre.prf
new file mode 100644
index 0000000000..2760889929
--- /dev/null
+++ b/mkspecs/features/wasm/default_pre.prf
@@ -0,0 +1,2 @@
+load(default_pre)
+load(emcc_ver)
diff --git a/mkspecs/features/wasm/emcc_ver.prf b/mkspecs/features/wasm/emcc_ver.prf
new file mode 100644
index 0000000000..505a321d64
--- /dev/null
+++ b/mkspecs/features/wasm/emcc_ver.prf
@@ -0,0 +1,23 @@
+defineReplace(qtEmccRecommendedVersion) {
+ return (1.38.27)
+}
+
+defineReplace(qtSystemEmccVersion) {
+ E_VERSION = $$system("emcc -v 2>&1 | perl -alne $$shell_quote($_ = $F[9]; s/://; print;) ")
+ return ($${E_VERSION})
+}
+
+defineTest(qtConfTest_emccVersion) {
+
+ REQ_VERSION = $$qtEmccRecommendedVersion()
+ EMCC_VERSION = $$qtSystemEmccVersion()
+
+ !defined(QT_EMCC_VERSION, var):!equals(EMCC_VERSION, $${REQ_VERSION}) {
+ warning ("You should use the recommended Emscripten version $$REQ_VERSION with this Qt. You have $${EMCC_VERSION} ")
+ }
+ contains(TEMPLATE, .*app) {
+ !equals(QT_EMCC_VERSION, $$EMCC_VERSION) {
+ warning("This Qt was built with Emscripten version $${QT_EMCC_VERSION}. You have $${EMCC_VERSION}. The difference may cause issues.")
+ }
+ }
+}
diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf
index 25413d7470..2e886fc4a5 100644
--- a/mkspecs/features/wasm/wasm.prf
+++ b/mkspecs/features/wasm/wasm.prf
@@ -1,8 +1,11 @@
+
# DESTDIR will be empty if not set in the app .pro file; make sure it has a value
isEmpty(DESTDIR): DESTDIR = $$OUT_PWD
exists($$QMAKE_QT_CONFIG) {
+## this may be subject to change
+
qtConfig(thread) {
EMCC_THREAD_LFLAGS += -s USE_PTHREADS=1
@@ -71,7 +74,7 @@ contains(TEMPLATE, .*app) {
# replacing the app name placeholder with the actual app name.
apphtml.name = application main html file
apphtml.output = $$DESTDIR/$$TARGET_HTML
- apphtml.commands = sed -e s/@APPNAME@/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML
+ apphtml.commands = $$QMAKE_STREAM_EDITOR -e s/@APPNAME@/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML
apphtml.input = $$WASM_PLUGIN_PATH/wasm_shell.html
apphtml.depends = $$apphtml.input
QMAKE_EXTRA_COMPILERS += apphtml
@@ -109,6 +112,8 @@ 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/