summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/resources.prf10
-rw-r--r--mkspecs/features/resources_functions.prf25
-rw-r--r--mkspecs/features/wasm/default_pre.prf25
-rw-r--r--mkspecs/features/wasm/wasm.prf5
4 files changed, 51 insertions, 14 deletions
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index ca95768de8..cee0981db0 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -6,16 +6,6 @@ isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
!contains(QMAKE_RESOURCE_FLAGS, -name): QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE}
-# http://www.w3.org/TR/xml/#syntax
-defineReplace(xml_escape) {
- 1 ~= s,&,&,
- 1 ~= s,\',',
- 1 ~= s,\",",
- 1 ~= s,<,&lt;,
- 1 ~= s,>,&gt;,
- return($$1)
-}
-
load(resources_functions)
qtFlattenResources()
diff --git a/mkspecs/features/resources_functions.prf b/mkspecs/features/resources_functions.prf
index f7fed9e524..b7a15fd1d9 100644
--- a/mkspecs/features/resources_functions.prf
+++ b/mkspecs/features/resources_functions.prf
@@ -1,5 +1,21 @@
+# http://www.w3.org/TR/xml/#syntax
+defineReplace(xml_escape) {
+ 1 ~= s,&,&amp;,
+ 1 ~= s,\',&apos;,
+ 1 ~= s,\",&quot;,
+ 1 ~= s,<,&lt;,
+ 1 ~= s,>,&gt;,
+ return($$1)
+}
+
defineTest(qtFlattenResources) {
- RESOURCES += qmake_immediate
+ immediate = qmake_immediate$$QMAKE_RESOURCES_IMMEDIATE_NR
+ defined(QMAKE_RESOURCES_IMMEDIATE_NR, var): \
+ QMAKE_RESOURCES_IMMEDIATE_NR = $$num_add($$QMAKE_RESOURCES_IMMEDIATE_NR, 1)
+ else: \
+ QMAKE_RESOURCES_IMMEDIATE_NR = 1
+
+ RESOURCES += $$immediate
for(resource, RESOURCES) {
# Regular case of user qrc file
contains(resource, ".*\\.qrc$"): \
@@ -7,10 +23,10 @@ defineTest(qtFlattenResources) {
# Fallback for stand-alone files/directories
!defined($${resource}.files, var) {
- !equals(resource, qmake_immediate) {
+ !equals(resource, $$immediate) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
- qmake_immediate.files += $$resource
+ $${immediate}.files += $$resource
OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
@@ -56,8 +72,9 @@ defineTest(qtFlattenResources) {
RESOURCES -= $$resource
RESOURCES += $$resource_file
}
+ export(QMAKE_RESOURCES_IMMEDIATE_NR)
export(RESOURCES)
export(OTHER_FILES)
- export(qmake_immediate.files)
+ export($${immediate}.files)
return(true)
}
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/