Commit 1cb3e727 authored by Michal Klocek's avatar Michal Klocek Committed by Jörg Bornemann
Browse files

Unify error reporting for configure


Move last two tests (submodule and nowhitespace) to configure
system and unify error reporting. Now all error
messages come from one single place qtwebengine_checkErrors().
This function is used by configure system reporting and by make call.
Remove duplicated strings.

Add extra messages when module is not going to be built.

Change-Id: Ib373facd58135325495aad52b6e600ec9a61f31f
Reviewed-by: default avatarJörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@qt.io>
Showing with 206 additions and 196 deletions
...@@ -340,3 +340,14 @@ defineTest(qtConfTest_hasGcc6OrNewer) { ...@@ -340,3 +340,14 @@ defineTest(qtConfTest_hasGcc6OrNewer) {
greaterThan(QMAKE_GCC_MAJOR_VERSION, 5):return(true) greaterThan(QMAKE_GCC_MAJOR_VERSION, 5):return(true)
return(false) return(false)
} }
defineTest(qtConfTest_detectSubmodule) {
!exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium):return(false)
return(true)
}
defineTest(qtConfTest_detectNoWhitespace) {
WSPC = $$find(OUT_PWD, \\s)
!isEmpty(WSPC):return(false)
return(true)
}
...@@ -98,113 +98,6 @@ defineReplace(gnOS) { ...@@ -98,113 +98,6 @@ defineReplace(gnOS) {
return(unknown) return(unknown)
} }
defineTest(isWebEngineCoreBuild) {
static {
qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
return(false)
}
!qtHaveModule(gui) {
qtwebengine_skipBuild("QtWebEngine requires QtGui.")
return(false)
}
!exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium) {
qtwebengine_skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
return(false)
}
WSPC = $$find(OUT_PWD, \\s)
!isEmpty(WSPC) {
qtwebengine_skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
return(false)
}
!qtwebengine_isPlatformSupported() {
# make sure we have skipBuildReason
isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknow error. Platform unspported.")
return(false)
}
!qtwebengine_isArchSupported() {
isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknown error. Architecture unsupported.")
return(false)
}
linux:contains(QT_CONFIG,no-pkg-config) {
qtwebengine_skipBuild("pkg-config is required")
return(false)
}
include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
QT_FOR_CONFIG += buildtools-private
win32:!qtConfig(webengine-win-compiler64) {
qtwebengine_skipBuild("Required 64-bit cross-building or native toolchain could not be found.")
return(false)
}
win32:!qtConfig(webengine-winversion) {
qtwebengine_skipBuild("Needs Visual Studio 2017 or higher")
return(false)
}
!qtConfig(webengine-gperf) {
qtwebengine_skipBuild("Required gperf could not be found.")
return(false)
}
!qtConfig(webengine-bison) {
qtwebengine_skipBuild("Required bison could not be found.")
return(false)
}
!qtConfig(webengine-flex) {
qtwebengine_skipBuild("Required flex could not be found.")
return(false)
}
!qtConfig(webengine-python2) {
qtwebengine_skipBuild("A suitable version of python2 could not be found.")
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);
}
linux {
!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)
}
QT_FOR_CONFIG += gui-private
!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(xcb) : !qtConfig(webengine-ozone-x11) {
qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support")
return(false)
}
}
}
defineReplace(pkgConfigHostExecutable) { defineReplace(pkgConfigHostExecutable) {
wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh
wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST
......
...@@ -12,7 +12,3 @@ OTHER_FILES = \ ...@@ -12,7 +12,3 @@ OTHER_FILES = \
config.tests/snappy/* \ config.tests/snappy/* \
config.tests/re2/* \ config.tests/re2/* \
mkspecs/features/* mkspecs/features/*
!isWebEngineCoreBuild():!isEmpty(skipBuildReason):!build_pass {
log(QtWebEngine will not be built. $${skipBuildReason} $${EOL})
}
...@@ -162,3 +162,118 @@ defineTest(qtwebengine_skipBuild) { ...@@ -162,3 +162,118 @@ defineTest(qtwebengine_skipBuild) {
else: skipBuildReason = "$$skipBuildReason $${EOL}$$1" else: skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason) export(skipBuildReason)
} }
defineTest(qtwebengine_checkError) {
include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
QT_FOR_CONFIG += buildtools-private gui-private
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)
}
!qtwebengine_isPlatformSupported() {
isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknow error. Platform unsupported.")
return(false)
}
!qtwebengine_isArchSupported() {
isEmpty(skipBuildReason): qtwebengine_skipBuild("Unknown error. Architecture unsupported.")
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)
}
...@@ -359,12 +359,19 @@ ...@@ -359,12 +359,19 @@
"webengine-architecture": { "webengine-architecture": {
"label": "architecture supported", "label": "architecture supported",
"type": "detectArch" "type": "detectArch"
},
"webengine-submodule" : {
"label": "submodule initialized",
"type": "detectSubmodule"
},
"webengine-nowhitespace" : {
"label": "build path without whitespace",
"type": "detectNoWhitespace"
} }
}, },
"features": { "features": {
"build-qtwebengine-core": { "webengine-core-support": {
"label": "Support Qt WebEngine Core", "label": "Support Qt WebEngine Core",
"purpose": "Provides WebEngine Core support.",
"condition": "module.gui "condition": "module.gui
&& features.webengine-python2 && features.webengine-python2
&& features.webengine-gperf && features.webengine-gperf
...@@ -372,11 +379,24 @@ ...@@ -372,11 +379,24 @@
&& features.webengine-flex && features.webengine-flex
&& tests.webengine-platform && tests.webengine-platform
&& tests.webengine-architecture && tests.webengine-architecture
&& tests.webengine-submodule
&& tests.webengine-nowhitespace
&& !config.static
&& (!config.linux || features.pkg-config) && (!config.linux || features.pkg-config)
&& (!features.xcb || features.webengine-ozone-x11) && (!features.xcb || features.webengine-ozone-x11)
&& (!config.win32 || features.webengine-winversion)", && (!config.win32 || features.webengine-winversion)",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
}, },
"build-qtwebengine-core": {
"label": "Build Qt WebEngine Core",
"purpose": "Provides WebEngine Core support.",
"output": [ "privateFeature" ]
},
"build-qtpdf": {
"label": "Support Qt PDF rendering module",
"purpose": "Enables building the Qt PDF rendering module.",
"output": [ "privateFeature" ]
},
"webengine-developer-build": { "webengine-developer-build": {
"label": "Developer build", "label": "Developer build",
"purpose": "Enables the developer build configuration.", "purpose": "Enables the developer build configuration.",
...@@ -631,66 +651,43 @@ ...@@ -631,66 +651,43 @@
"label": "64bit compiler", "label": "64bit compiler",
"condition": "config.win32 && tests.webengine-win-compiler64", "condition": "config.win32 && tests.webengine-win-compiler64",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
},
"webengine-submodule": {
"label": "submodule",
"condtion": "tests.webengine-submodule",
"output": [ "privateFeature" ]
},
"webengine-nowhitespace": {
"label": "nowhitespace",
"condition" : "tests.webengine-nowhitespace",
"output": [ "privateFeature" ]
} }
}, },
"report": [ "report": [
{ {
"type": "warning", "type": "skipBuildWarning",
"condition": "!module.gui", "condition": "!features.webengine-core-support && (features.build-qtwebengine-core || features.build-qtpdf)",
"message": "QtWebEngine requires QtGui." "message": "qtwebengine_checkError"
},
{
"type": "warning",
"condition": "!features.webengine-python2",
"message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine."
},
{
"type": "warning",
"condition": "!features.webengine-gperf",
"message": "gperf is required to build QtWebEngine."
},
{
"type": "warning",
"condition": "!features.webengine-bison",
"message": "bison is required to build QtWebEngine."
},
{
"type": "warning",
"condition": "!features.webengine-flex",
"message": "flex is required to build QtWebEngine."
}, },
{ {
"type": "warning", "type": "note",
"condition": "config.linux && !features.pkg-config", "condition": "features.webengine-core-support && !features.build-qtwebengine-core",
"message": "Could not find pkg-config." "message": "QtWebEngine build is disabled by user."
}, },
{ {
"type": "warning", "type": "note",
"condition": "config.linux "condition": "features.webengine-core-support && !features.build-qtpdf",
&& features.pkg-config "message": "QtPdf build is disabled by user."
&& features.xcb
&& !features.webengine-ozone-x11",
"message": "Could not find all necessary libraries for qpa-xcb support."
}, },
{ {
"type": "warning", "type": "warning",
"condition": "config.win32 && !features.webengine-winversion", "condition": "!features.webengine-core-support && features.build-qtwebengine-core",
"message": "Needs Visual Studio 2017 or higher." "message": "QtWebEngine will not be built."
}, },
{ {
"type": "warning", "type": "warning",
"condition": "config.win32 && !features.webengine-win-compiler64", "condition": "!features.webengine-core-support && features.build-qtpdf",
"message": "64-bit cross-building or native toolchain is required to build QtWebEngine." "message": "QtPdf will not be built."
},
{
"type": "skipBuildWarning",
"condition": "tests.webengine-platform",
"message": "qtwebengine_isPlatformSupported"
},
{
"type": "skipBuildWarning",
"condition": "tests.webengine-architecture",
"message": "qtwebengine_isArchSupported"
} }
], ],
"summary": [ "summary": [
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"gui-private", "gui-private",
"printsupport" "printsupport"
], ],
"condition": "features.build-qtwebengine-core", "condition": "features.build-qtwebengine-core && features.webengine-core-support",
"testDir": "../../config.tests", "testDir": "../../config.tests",
"commandline": { "commandline": {
"options": { "options": {
......
...@@ -10,42 +10,40 @@ QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private webengin ...@@ -10,42 +10,40 @@ QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private webengin
TEMPLATE = subdirs TEMPLATE = subdirs
isWebEngineCoreBuild(){
qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support) {
qtConfig(build-qtwebengine-core) { core.depends = buildtools
process.depends = core
core.depends = buildtools webengine.depends = core
process.depends = core webenginewidgets.depends = core webengine
webengine.depends = core webengine_plugin.subdir = webengine/plugin
webenginewidgets.depends = core webengine webengine_plugin.target = sub-webengine-plugin
webengine_plugin.subdir = webengine/plugin webengine_plugin.depends = webengine
webengine_plugin.target = sub-webengine-plugin
webengine_plugin.depends = webengine SUBDIRS += buildtools core process
SUBDIRS += buildtools core process qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile {
SUBDIRS += qwebengine_convert_dict
qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile { qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict
SUBDIRS += qwebengine_convert_dict qwebengine_convert_dict.depends = core
qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict }
qwebengine_convert_dict.depends = core
} qtConfig(webengine-qml) {
SUBDIRS += webengine
qtConfig(webengine-qml) {
SUBDIRS += webengine
}
qtConfig(webengine-widgets) {
SUBDIRS += plugins webenginewidgets
plugins.depends = webenginewidgets
}
} }
} else {
!isEmpty(skipBuildReason):!build_pass { qtConfig(webengine-widgets) {
log(QtWebEngine will not be built. $${skipBuildReason} $${EOL}) SUBDIRS += plugins webenginewidgets
errorbuild.commands = @echo QtWebEngine will not be built. $${skipBuildReason} plugins.depends = webenginewidgets
errorbuild.CONFIG = phony }
QMAKE_EXTRA_TARGETS += errorbuild }
first.depends += errorbuild
QMAKE_EXTRA_TARGETS += first !qtConfig(webengine-core-support): qtConfig(build-qtwebengine-core) {
!qtwebengine_checkError():!isEmpty(skipBuildReason):!build_pass {
errorbuild.commands = @echo Modules will not be built. $${skipBuildReason}
errorbuild.CONFIG = phony
QMAKE_EXTRA_TARGETS += errorbuild
first.depends += errorbuild
QMAKE_EXTRA_TARGETS += first
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment