summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2019-08-26 18:18:34 +1000
committerLorn Potter <lorn.potter@gmail.com>2019-12-11 06:06:45 +1000
commit93d261b9650e3d1eb9347310fe8fc1f18e54e328 (patch)
tree35c5f786541299e7f5e349ea437efa7661cdd6fd /mkspecs/features
parentbf65c277892f6f322fa689c06d81ba9b1d9a8038 (diff)
wasm: enforce emscripten version
This creates a define in the binary, as well as writing emscripten version for qmake. It also enforces app builder to use a certain known version. Task-number: QTBUG-77745 Change-Id: I37691512171635cec66aa3ffa16258081f3f1e1b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/wasm/default_pre.prf25
-rw-r--r--mkspecs/features/wasm/wasm.prf5
2 files changed, 30 insertions, 0 deletions
diff --git a/mkspecs/features/wasm/default_pre.prf b/mkspecs/features/wasm/default_pre.prf
new file mode 100644
index 0000000000..982ef0498f
--- /dev/null
+++ b/mkspecs/features/wasm/default_pre.prf
@@ -0,0 +1,25 @@
+load(default_pre)
+
+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 5773e58010..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
@@ -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/