diff --git a/config.tests/hostcompiler/hostcompiler.pro b/config.tests/hostcompiler/hostcompiler.pro new file mode 100644 index 0000000000000000000000000000000000000000..5a80246ab0175e72050b00c3fe25f10ec52d7cd4 --- /dev/null +++ b/config.tests/hostcompiler/hostcompiler.pro @@ -0,0 +1,9 @@ +option(host_build) + +gcc:equals(QT_ARCH, "x86_64"):contains(QT_TARGET_ARCH, "arm"):!contains(QT_TARGET_ARCH, "arm64") { + QMAKE_CXXFLAGS += -m32 + QMAKE_LFLAGS += -m32 +} + +SOURCES = main.cpp + diff --git a/config.tests/hostcompiler/main.cpp b/config.tests/hostcompiler/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..96444ae8bdd0dc9ecf8cdb41b36fe2caf799867a --- /dev/null +++ b/config.tests/hostcompiler/main.cpp @@ -0,0 +1,6 @@ +#include <stdio.h> +int main() +{ + printf("This works\n"); + return 0; +} diff --git a/configure.json b/configure.json index fecd83ed4482d7ea2d997dc6487f7d68e0fcb016..9c9285953013a2aa37af50abae1e7a2b079d3546 100644 --- a/configure.json +++ b/configure.json @@ -21,8 +21,8 @@ "webengine-spellchecker": "boolean", "webengine-native-spellchecker": "boolean", "webengine-webrtc": "boolean", - "webengine-geolocation" : "boolean", - + "webengine-geolocation": "boolean", + "webengine-v8-snapshot": "boolean", "alsa": { "type": "boolean", "name": "webengine-alsa" }, "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" }, "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, @@ -189,6 +189,11 @@ "test": "alsa", "type": "compile" }, + "webengine-host-compiler": { + "label": "host compiler", + "test": "hostcompiler", + "type": "compile" + }, "webengine-khr": { "label": "khr", "test": "khr", @@ -396,6 +401,16 @@ "condition": "config.unix && tests.alsa", "output": [ "privateFeature" ] }, + "webengine-v8-snapshot": { + "label" : "Use v8 snapshot", + "purpuse": "Enables the v8 snapshot, for fast v8 context creation", + "output": [ "privateFeature" ] + }, + "webengine-v8-snapshot-support": { + "autoDetect": "features.webengine-v8-snapshot", + "condition": "!config.unix || !features.webengine-embedded-build || tests.webengine-host-compiler", + "output": [ "privateFeature" ] + }, "webengine-system-khr" : { "label": "khr", "condition": "config.unix && tests.webengine-khr", @@ -600,6 +615,7 @@ "webengine-webrtc", "webengine-system-ninja", "webengine-geolocation", + "webengine-v8-snapshot-support", { "type": "feature", "args": "webengine-alsa", diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index 2c09085985146e0fe12c438f89f59aacecf910f7..f8c15465571fcde0c2d193e2bccd37331af1b2c9 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -30,6 +30,13 @@ defineTest(runConfigure) { include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) QT_FOR_CONFIG += webengine-private + !qtConfig(webengine-v8-snapshot-support):qtConfig(webengine-v8-snapshot) { + skipBuild("V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work."\ + "Please make sure you have 32-bit devel environment installed, or "\ + "configure webengine with '-no-webengine-v8-snapshot'") + return(false) + } + !qtConfig(webengine-gperf) { skipBuild("Required gperf could not be found.") return(false) diff --git a/src/core/config/common.pri b/src/core/config/common.pri index 8961e1cd36d97c83319c0d5791a9533ba5ae9bf6..ab2a609782d3815425501a0b29d0c5e4649566c1 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -84,3 +84,10 @@ optimize_size: gn_args += optimize_for_size=true # rtti, linking would fail at build time. sanitize_undefined: gn_args += is_ubsan=true use_rtti=true } + +qtConfig(webengine-v8-snapshot) { + gn_args += v8_use_snapshot=true +} else { + gn_args += v8_use_snapshot=false +} +