summaryrefslogtreecommitdiffstats
path: root/tools/qmake/mkspecs/features
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-01-16 18:24:17 +0100
commit0fc1516692fb11f3489bce11a8f0cc15ad8f6b63 (patch)
treed39aa29c33b87430598fe17751a7d65529792660 /tools/qmake/mkspecs/features
parentdb2f69bb58ab369e44ea8bb30dcdbe90660578a2 (diff)
parentae657b918ff22da2553dc577c877b03f49cc2bdf (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/3rdparty Change-Id: Ied43de29444d4803218e250b096b9c72bc017af7
Diffstat (limited to 'tools/qmake/mkspecs/features')
-rw-r--r--tools/qmake/mkspecs/features/configure.prf31
-rw-r--r--tools/qmake/mkspecs/features/default_post.prf8
-rw-r--r--tools/qmake/mkspecs/features/default_pre.prf7
-rw-r--r--tools/qmake/mkspecs/features/functions.prf20
-rw-r--r--tools/qmake/mkspecs/features/gyp_generator.prf5
5 files changed, 63 insertions, 8 deletions
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
new file mode 100644
index 000000000..6e74b5547
--- /dev/null
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -0,0 +1,31 @@
+# Load configure.prf from qtbase first
+load(configure)
+load(functions)
+
+defineTest(runConfigure) {
+ webengine_successfully_configured: return(true)
+ linux:contains(QT_CONFIG,no-pkg-config) {
+ skipBuild("pkg-config is required")
+ return(false)
+ }
+ # Ignore the cached config tests results in case they were not successful
+ CONFIG += recheck
+ #Override the config.tests path
+ QMAKE_CONFIG_TESTS_DIR = $$QTWEBENGINE_ROOT/tools/qmake/config.tests
+ CONFIG_TESTS = $$files($$QMAKE_CONFIG_TESTS_DIR/*.pro, true)
+ log("Running configure tests$${EOL}")
+ for(test, CONFIG_TESTS) {
+ test = $$basename(test)
+ test ~= s/\\.pro$//
+ qtCompileTest($$test)
+ }
+ # libcap-dev package doesn't ship .pc files on Ubuntu.
+ linux:!config_libcap:skipBuild("libcap appears to be missing")
+ contains(QT_CONFIG, xcb) {
+ for(package, $$list("libdrm xcomposite xi xrandr")) {
+ !packagesExist($$package):skipBuild("Unmet dependency: $$package")
+ }
+ }
+ isEmpty(skipBuildReason):cache(CONFIG, add, $$list(webengine_successfully_configured))
+}
+
diff --git a/tools/qmake/mkspecs/features/default_post.prf b/tools/qmake/mkspecs/features/default_post.prf
new file mode 100644
index 000000000..d09ba05fd
--- /dev/null
+++ b/tools/qmake/mkspecs/features/default_post.prf
@@ -0,0 +1,8 @@
+load(default_post)
+
+!isEmpty(skipBuildReason) {
+ SUBDIRS =
+ export(SUBDIRS)
+ log($${skipBuildReason}$${EOL})
+ log(QtWebEngine will not be built.$${EOL})
+}
diff --git a/tools/qmake/mkspecs/features/default_pre.prf b/tools/qmake/mkspecs/features/default_pre.prf
index aeb7c0b3b..02f4f24d4 100644
--- a/tools/qmake/mkspecs/features/default_pre.prf
+++ b/tools/qmake/mkspecs/features/default_pre.prf
@@ -9,8 +9,15 @@ QTWEBENGINEPROCESS_NAME = QtWebEngineProcess
# Location of sync.profile
MODULE_BASE_DIR = $$QTWEBENGINE_ROOT
+EOL = $$escape_expand(\\n)
load(functions)
+# Check platform support and run config tests early enough to bail
+equals(_PRO_FILE_, "$$QTWEBENGINE_ROOT/qtwebengine.pro"): isPlatformSupported() {
+ load(configure)
+ runConfigure()
+}
+
# Call the original default_pre.
load(default_pre)
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index 3a25bb0d6..338a9ec27 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -1,16 +1,19 @@
defineTest(isPlatformSupported) {
- static: return(false)
+ static {
+ skipBuild("Static builds of QtWebEngine aren't supported.")
+ return(false)
+ }
osx:lessThan(QMAKE_XCODE_VERSION, 5.1) {
- warning("Using xcode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
+ skipBuild("Using xcode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
return(false)
}
- linux-g++*:!isGCCVersionSupported():return(false)
+ linux-g++*:!isGCCVersionSupported(): return(false)
!isPythonVersionSupported(): return(false)
linux-g++*|win32-msvc2013|macx-clang: return(true)
boot2qt: return(true)
- warning("Qt WebEngine can currently only be built for Linux (GCC), Windows (MSVC 2013), OS X (XCode 5.1+) or Qt for Device Creation".)
+ skipBuild("Qt WebEngine can currently only be built for Linux (GCC), Windows (MSVC 2013), OS X (XCode 5.1+) or Qt for Device Creation.")
return(false)
}
@@ -18,7 +21,7 @@ defineTest(isPythonVersionSupported) {
python_major_version = $$system('python -c "import sys; print sys.version_info.major"')
python_minor_version = $$system('python -c "import sys; print sys.version_info.minor"')
greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true)
- warning("Using Python version "$$python_major_version"."$$python_minor_version", but at least Python version 2.7 is required to build Qt WebEngine.")
+ skipBuild("Using Python version "$$python_major_version"."$$python_minor_version", but at least Python version 2.7 is required to build Qt WebEngine.")
return(false)
}
@@ -26,7 +29,7 @@ defineTest(isGCCVersionSupported) {
# The below will work for gcc 4.6 and up and also match gcc 5
greaterThan(QT_GCC_MINOR_VERSION, 5):return(true)
greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
- warning("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.6 is required to build Qt WebEngine.")
+ skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.6 is required to build Qt WebEngine.")
return(false)
}
@@ -142,3 +145,8 @@ defineReplace(findOrBuildNinja) {
}
return($$out)
}
+
+defineTest(skipBuild) {
+ skipBuildReason = "$$skipBuildReason $${EOL}$$1"
+ export(skipBuildReason)
+}
diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf
index 5ef3110cc..eea11ef09 100644
--- a/tools/qmake/mkspecs/features/gyp_generator.prf
+++ b/tools/qmake/mkspecs/features/gyp_generator.prf
@@ -24,7 +24,7 @@ defineReplace(mocAction) {
" 'inputs': ['$$INPUT_FILE',]," \
" 'outputs': ['$$OUTPUT_FILE',]," \
" 'action': ["
- for(token, MOC_COMMAND): contents += " '$$token',"
+ for(token, MOC_COMMAND): contents += " '$$replace(token,\',)',"
contents += " '$$INPUT_FILE'," \
" '-o'," \
" '$$OUTPUT_FILE'," \
@@ -39,12 +39,13 @@ defineReplace(rccAction) {
OUTPUT_NAME = $$rccOutput($$INPUT_FILE)
EXTERN_FUNC = $$rccExternFunc($$INPUT_FILE)
OUTPUT_FILE = $$RCC_GEN_DIR/$${OUTPUT_NAME}
+ CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC)
contents = " {" \
" 'action_name':'$$OUTPUT_NAME'," \
" 'inputs': ['$$INPUT_FILE',]," \
" 'outputs': ['$$OUTPUT_FILE',]," \
" 'action': [" \
- " '$$clean_path($$QMAKE_RCC)',"
+ " '$$replace(CLEAN_QMAKE_RCC,\',)',"
for(resource_flag, $$QMAKE_RESOURCE_FLAGS): contents += " '$$resource_flag',"
contents += " '-name'," \
" '$$EXTERN_FUNC'," \