summaryrefslogtreecommitdiffstats
path: root/src/buildtools/config/support.pri
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-09-05 08:55:38 +0200
committerMichal Klocek <michal.klocek@qt.io>2019-09-19 09:52:44 +0200
commite29f450d7359c9390165268db8d9c6667c96ed96 (patch)
treef154ddaf3d88eabbb2ab38a7d98715b88b294f40 /src/buildtools/config/support.pri
parentd9bbf709cd0a2013833863a66396bc62f0165f48 (diff)
Clean up platform tests
Make it a private feature so test is not run twice. The better solution would be to split the platform test into separate tests in configure, but it looks like a lot of boring typing and would result in bunch on private features. Instead run test only on configure step and in case of fail just export the error, so it is reported during configure and make calls. Change-Id: Ice1188631a53fe739569de3e303533b18342941a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/buildtools/config/support.pri')
-rw-r--r--src/buildtools/config/support.pri133
1 files changed, 133 insertions, 0 deletions
diff --git a/src/buildtools/config/support.pri b/src/buildtools/config/support.pri
new file mode 100644
index 000000000..7c1262f85
--- /dev/null
+++ b/src/buildtools/config/support.pri
@@ -0,0 +1,133 @@
+defineTest(qtwebengine_skipBuild) {
+ isEmpty(skipBuildReason): skipBuildReason = $$1
+ else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
+ export(skipBuildReason)
+}
+
+defineReplace(qtwebengine_checkError) {
+
+ static {
+ qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
+ return(false)
+ }
+
+ !qtHaveModule(gui) {
+ qtwebengine_skipBuild("QtWebEngine requires QtGui.")
+ return(false)
+ }
+
+ !qtConfig(webengine-submodule) {
+ qtwebengine_skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
+ return(false)
+ }
+
+ !qtConfig(webengine-nowhitespace) {
+ qtwebengine_skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
+ return(false)
+ }
+
+ qtConfig(webengine-no-platform-support) {
+ !isEmpty(platformError) {
+ qtwebengine_skipBuild($$platformError)
+ return(false)
+ }
+ !isEmpty(QTWEBENGINE_OUT_ROOT) {
+ include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
+ QT_FOR_CONFIG += buildtools-private
+ qtwebengine_skipBuild($$PLATFORM_ERROR)
+ return(false)
+ }
+ qtwebengine_skipBuild("QtWebEngine will not be built. Platform unsupported.") # re-run of configure when topLevel build
+ return(false):
+ }
+
+ !qtConfig(webengine-arch-support) {
+ qtwebengine_skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
+ return(false)
+ }
+
+ !qtConfig(webengine-gperf) {
+ qtwebengine_skipBuild("Tool gperf is required to build QtWebEngine.")
+ return(false)
+ }
+
+ !qtConfig(webengine-bison) {
+ qtwebengine_skipBuild("Tool bison is required to build QtWebEngine.")
+ return(false)
+ }
+
+ !qtConfig(webengine-flex) {
+ qtwebengine_skipBuild("Tool flex is required to build QtWebEngine.")
+ return(false)
+ }
+
+ !qtConfig(webengine-python2) {
+ qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build QtWebEngine.")
+ return(false)
+ }
+
+ linux:!qtwebengine_checkErrorForLinux():return(false)
+ win:!qtwebengine_checkErrorForWindows():return(false)
+
+ sanitizer: !qtConfig(webengine-sanitizer) {
+ qtwebengine_skipBuild("Chosen sanitizer configuration is not supported. Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
+ return(false);
+ }
+
+ return(true)
+}
+
+defineTest(qtwebengine_checkErrorForLinux) {
+
+ !qtConfig(pkg-config) {
+ qtwebengine_skipBuild("A pkg-config support is required.")
+ return(false)
+ }
+
+ !qtConfig(webengine-host-pkg-config) {
+ qtwebengine_skipBuild("Host pkg-config is required")
+ return(false)
+ }
+
+ !qtConfig(webengine-system-glibc) {
+ qtwebengine_skipBuild("A suitable version >= 2.27 of libc could not be found.")
+ return(false)
+ }
+
+ !qtConfig(webengine-system-khr) {
+ qtwebengine_skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
+ return(false)
+ }
+
+ for(package, $$list("nss dbus fontconfig")) {
+ !qtConfig(webengine-system-$$package) {
+ qtwebengine_skipBuild("A suitable version of $$package could not be found.")
+ return(false)
+ }
+ }
+
+ qtConfig(pkg-config):qtConfig(xcb):!qtConfig(webengine-ozone-x11) {
+ qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support")
+ return(false)
+ }
+ return(true)
+}
+
+defineTest(qtwebengine_checkErrorForWindows) {
+ !qtConfig(webengine-win-compiler64) {
+ qtwebengine_skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
+ return(false)
+ }
+
+ !qtConfig(webengine-winversion) {
+ qtwebengine_skipBuild("Needs Visual Studio 2017 or higher")
+ return(false)
+ }
+ return(true)
+}
+
+defineTest(qtwebengine_makeCheckError) {
+ include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
+ QT_FOR_CONFIG += buildtools-private gui-private
+ return($$qtwebengine_checkError())
+}