summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/configure.prf237
-rw-r--r--mkspecs/features/functions.prf295
-rw-r--r--mkspecs/features/platform.prf150
3 files changed, 218 insertions, 464 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 52772a562..904e7b1c0 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -1,201 +1,84 @@
# Load configure.prf from qtbase first
load(configure)
load(functions)
+load(platform)
defineTest(runConfigure) {
- webengine_successfully_configured: return(true)
- linux:contains(QT_CONFIG,no-pkg-config) {
- skipBuild("pkg-config is required")
+
+ !exists(src/3rdparty/chromium) {
+ skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
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/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)
- }
- isQtMinimum(5, 8) {
- include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
- QT_FOR_CONFIG += webengine-private
-
- qtConfig(pepper-plugins): WEBENGINE_CONFIG += use_pepper_plugins
- qtConfig(printing-and-pdf): WEBENGINE_CONFIG += use_printing use_pdf
- qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs
- qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker
- qtConfig(webrtc): WEBENGINE_CONFIG += use_webrtc
- qtConfig(embedded): WEBENGINE_CONFIG += embedded_build
- qtConfig(system-webp): WEBENGINE_CONFIG += use_system_libwebp
- qtConfig(system-opus): WEBENGINE_CONFIG += use_system_opus
- qtConfig(system-ffmpeg): WEBENGINE_CONFIG += use_system_ffmpeg
- qtConfig(system-icu): WEBENGINE_CONFIG += use_system_icu
- qtConfig(system-re2): WEBENGINE_CONFIG += use_system_re2
- !contains(WEBENGINE_CONFIG, use_system_libwebp): WEBENGINE_CONFIG += use_bundled_libwebp
- !contains(WEBENGINE_CONFIG, use_system_opus): WEBENGINE_CONFIG += use_bundled_opus
- !contains(WEBENGINE_CONFIG, use_system_ffmpeg): WEBENGINE_CONFIG += use_bundled_ffmpeg
- !contains(WEBENGINE_CONFIG, use_system_icu): WEBENGINE_CONFIG += use_bundled_icu
- } else {
- # Feature defaults when building with Qt 5.6 LTS:
- cross_compile {
- WEBENGINE_CONFIG += embedded_build reduce_binary_size
- } else {
- WEBENGINE_CONFIG += use_spellchecker use_webrtc use_pepper_plugins use_printing use_pdf
- }
- }
- isQtMinimum(5, 9) {
- qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code
- optimize_size: WEBENGINE_CONFIG += reduce_binary_size
- } else {
- qtConfig(embedded): WEBENGINE_CONFIG += reduce_binary_size
+ WSPC = $$find(OUT_PWD, \\s)
+ !isEmpty(WSPC) {
+ skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.")
+ return(false)
}
- linux {
- QT_FOR_CONFIG += gui-private
- !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
+ !isPlatformSupported() {
+ # make sure we have skipBuildReason
+ isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported")
+ return(false)
+ }
- REQUIRED_PACKAGES = dbus-1 fontconfig
- !contains(WEBENGINE_CONFIG, embedded_build): qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xtst
- qtConfig(pulseaudio): REQUIRED_PACKAGES += libpulse
- qtConfig(system-png): REQUIRED_PACKAGES += libpng
- qtConfig(system-harfbuzz) {
- packagesExist("\'harfbuzz >= 1.2.0\'"): WEBENGINE_CONFIG += use_system_harfbuzz
- else: log("System harfbuzz is too old (min. version 1.2). Using Chromium's copy.$${EOL}")
- }
- qtConfig(glib) {
- packagesExist("\'glib-2.0 >= 2.32.0\'"): WEBENGINE_CONFIG += use_glib
- }
+ linux:contains(QT_CONFIG,no-pkg-config) {
+ skipBuild("pkg-config is required")
+ return(false)
+ }
- for(package, $$list($$REQUIRED_PACKAGES)) {
- !packagesExist($$package):skipBuild("Unmet dependency: $$package")
- }
- packagesExist(minizip, zlib): WEBENGINE_CONFIG += use_system_minizip use_system_zlib
- else: log("System zlib or minizip not found. Using Chromium's copies.$${EOL}")
- !isQtMinimum(5, 8) {
- packagesExist(libwebp,libwebpdemux): WEBENGINE_CONFIG += use_system_libwebp use_system_libwebpdemux
- else: log("System libwebp or libwebpdemux not found. Using Chromium's copies.$${EOL}")
- packagesExist(opus): WEBENGINE_CONFIG += use_system_opus
- else: log("System opus not found. Using Chromium's copy.$${EOL}")
- }
- packagesExist(libxml-2.0,libxslt) {
- PKGCONFIG_LIBS_STATIC = $$system($$PKG_CONFIG --libs --static libxml-2.0)
- contains(PKGCONFIG_LIBS_STATIC, -licuuc) {
- WEBENGINE_CONFIG += use_system_libxslt use_system_libxml2
- } else {
- log("System libxml2 is not configured with ICU. Using Chromium's copy.$${EOL}")
- }
- }
- else: log("System libxml2 or libxslt not found. Using Chromium's copies.$${EOL}")
- for(package, $$list("libevent jsoncpp protobuf")) {
- packagesExist($$package): WEBENGINE_CONFIG += use_system_$$package
- else {
- log("System $$package not found. Using Chromium's copy.$${EOL}")
- WEBENGINE_CONFIG += use_bundled_$$package
- }
- }
- use?(system_protobuf) {
- !system("which protoc > /dev/null") {
- log("Protobuf compiler not found. Using Chromium's copy of protobuf.$${EOL}")
- WEBENGINE_CONFIG -= use_system_protobuf
- WEBENGINE_CONFIG += use_bundled_protobuf
- }
- }
- config_libvpx: WEBENGINE_CONFIG += use_system_vpx
- else {
- log("Compatible system libvpx not found. Using Chromium's copy.$${EOL}")
- WEBENGINE_CONFIG += use_bundled_libvpx
- }
- config_snappy: WEBENGINE_CONFIG += use_system_snappy
- else {
- log("System snappy not found. Using Chromium's copy.$${EOL}")
- WEBENGINE_CONFIG += use_bundled_snappy
- }
+ include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+ QT_FOR_CONFIG += webengine-private
- packagesExist(nss): WEBENGINE_CONFIG += use_nss
- else: log("System NSS not found, BoringSSL will be used.$${EOL}")
+ !qtConfig(webengine-gperf) {
+ skipBuild("Required gperf could not be found.")
+ return(false)
+ }
+ !qtConfig(webengine-bison) {
+ skipBuild("Required bison could not be found.")
+ return(false)
+ }
+ !qtConfig(webengine-flex) {
+ skipBuild("Required flex could not be found.")
+ return(false)
+ }
+ !qtConfig(webengine-python2) {
+ skipBuild("A suitable version of python2 could not be found.")
+ return(false)
}
- win32 {
- !config_winversion: skipBuild("Needs VS 2015 Update 3 with Cumulative Servicing Release or higher")
+ sanitizer: !qtConfig(webengine-sanitizer) {
+ skipBuild("Chosen sanitizer configuration is not supported. Use --feature-webengine-sanitizer=yes to force build with the chosen sanitizer configuration.")
+ return(false);
}
- isEmpty(skipBuildReason): {
- cache(CONFIG, add, $$list(webengine_successfully_configured))
- !isEmpty(WEBENGINE_CONFIG) {
- cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG))
- export(WEBENGINE_CONFIG)
+ linux {
+ !qtConfig(webengine-system-glibc) {
+ skipBuild("A suitable version of libc could not be found. See: https://sourceware.org/bugzilla/show_bug.cgi?id=14898")
+ return(false)
}
- }
- unix:!darwin {
- log("System library dependencies:$${EOL}")
- !isQtMinimum(5, 8) {
- use?(system_icu) {
- packagesExist("\'icu-uc >= 53\', \'icu-i18n >= 53\'") {
- log(" ICU ................................ Using system version$${EOL}")
- } else {
- log(" ICU ................................ System ICU not found$${EOL}")
- skipBuild("Unmet dependencies: icu-uc, icu-i18n")
- }
- } else {
- log(" ICU ................................ Using internal copy (Default, force system ICU with WEBENGINE_CONFIG+=use_system_icu)$${EOL}")
- WEBENGINE_CONFIG += use_bundled_icu
- }
- use?(system_ffmpeg) {
- packagesExist("libavcodec libavformat libavutil") {
- packagesExist("libwebp, libwebpdemux, opus, \'vpx >= 1.4\'"){
- log(" FFMPEG ............................. Using system version$${EOL}")
- } else {
- log(" FFMPEG ............................. Conflicting FFMPEG dependencies$${EOL}")
- skipBuild("Unmet dependencies: opus, vpx, libwebp, libwebpdemux")
- }
- } else {
- log(" FFMPEG ............................. System FFMPEG not found$${EOL}")
- skipBuild("Unmet dependencies: libavcodec, libavformat, libavutil")
- }
- } else {
- log(" FFMPEG ............................. Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG+=use_system_ffmpeg)$${EOL}")
- WEBENGINE_CONFIG += use_bundled_ffmpeg
- }
+ QT_FOR_CONFIG += gui-private
+
+ !qtConfig(webengine-system-khr) {
+ skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
+ return(false)
}
- for(config, WEBENGINE_CONFIG) {
- match = $$find(config, "^use_system_")
- !isEmpty(match) {
- use_system += $$replace(match, ^use_system_,)
- }
- match = $$find(config, "^use_bundled_")
- !isEmpty(match) {
- use_bundled += $$replace(match, ^use_bundled_,)
+
+ for(package, $$list("nss dbus fontconfig")) {
+ !qtConfig(webengine-system-$$package) {
+ skipBuild("A suitable version of $$package could not be found.")
+ return(false)
}
- }
- !isEmpty(use_system): log(" Optional system libraries used ..... $$use_system$${EOL}")
- !isEmpty(use_bundled): log(" Optional bundled libraries used .... $$use_bundled$${EOL}")
- }
- log("Configurable features:$${EOL}")
- qtHaveModule(positioning): {
- log(" Geolocation ........................ Enabled$${EOL}")
- } else {
- log(" Geolocation ........................ Not enabled (Requires Qt Positioning module)$${EOL}")
- }
- unix:!darwin {
- use?(nss) {
- log(" Certificate handling ............... Using system NSS$${EOL}")
- } else {
- log(" Certificate handling ............... Using bundled BoringSSL$${EOL}")
- }
- }
- osx {
- use?(native_spellchecker) {
- log("Native Spellchecker .............. Enabled$${EOL}")
- } else {
- log("Native Spellchecker .............. Not enabled (Default, enable with WEBENGINE_CONFIG+=use_native_spellchecker)$${EOL}")
- }
- !isMinOSXSDKVersion(10, 10, 3) {
- log(" Force Touch API usage .............. Not enabled (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}")
+ }
+
+ !qtConfig(webengine-embedded-build): qtConfig(xcb) {
+ for(package, $$list("libdrm xcomposite xcursor xi xrandr xtst")) {
+ !qtConfig(webengine-system-$$package) {
+ skipBuild("A suitable version of $$package could not be found.")
+ return(false)
+ }
+ }
}
}
}
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
index b78d2a112..3b9a400b1 100644
--- a/mkspecs/features/functions.prf
+++ b/mkspecs/features/functions.prf
@@ -1,285 +1,6 @@
-defineTest(isQtMinimum) {
- !equals(QT_MAJOR_VERSION, $$1): return(false)
- count(ARGS, 1, greaterThan) {
- lessThan(QT_MINOR_VERSION, $$2): return(false)
- }
- return(true)
-}
-
-!isQtMinimum(5, 8) {
- defineTest(qtConfig) {
- contains(QT_CONFIG, $$1): return(true)
- return(false)
- }
-}
-
-defineTest(isPlatformSupported) {
- QT_FOR_CONFIG += gui-private
- linux {
- if(!gcc:!clang)|intel_icc {
- skipBuild("Qt WebEngine on Linux requires clang or GCC.")
- return(false)
- }
- gcc:!clang:!isGCCVersionSupported(): return(false)
- } else:win32 {
- winrt {
- skipBuild("WinRT is not supported.")
- return(false)
- }
- isBuildingOnWin32() {
- skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
- }
- !msvc|intel_icl {
- skipBuild("Qt WebEngine on Windows requires MSVC.")
- return(false)
- }
- !isMinWinSDKVersion(10, 10586): {
- skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.10586 or newer.")
- return(false)
- }
- } else:osx {
- lessThan(QMAKE_XCODE_VERSION, 5.1) {
- skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
- return(false)
- }
- !clang|intel_icc {
- skipBuild("Qt WebEngine on macOS requires Clang.")
- return(false)
- }
- # We require OS X 10.0 (darwin version 14.0.0) or newer
- darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
- lessThan(darwin_major_version, 14) {
- skipBuild("Qt WebEngine requires OS X version 10.10 or newer.")
- return(false)
- }
- !isMinOSXSDKVersion(10, 10): {
- skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
- }
- } else {
- skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and OS X.")
- return(false)
- }
-
- !contains(QT_CONFIG, c++11) {
- skipBuild("C++11 support is required in order to build chromium.")
- return(false)
- }
- qtConfig(mirclient) {
- skipBuild("Mir is not yet supported as graphics backend for Qt WebEngine.")
- return(false)
- }
- static {
- skipBuild("Static builds of QtWebEngine aren't supported.")
- return(false)
- }
- !isArchSupported(): return(false)
- isSanitizerEnabled():!isSanitizerSupported():!forceSanitizerBuild(): return(false)
- return(true)
-}
-
-defineTest(isArchSupported) {
- contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true)
- contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
- contains(QT_ARCH, "mips"): return(true)
-# contains(QT_ARCH, "mips64"): return(true)
-
- skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
- return(false)
-}
-
-defineTest(isSanitizerEnabled) {
- sanitize_address|sanitize_memory|sanitize_undefined|sanitize_thread: return(true)
- return(false)
-}
-
-defineTest(forceSanitizerBuild) {
- contains(WEBENGINE_CONFIG, force_sanitizer_build): return(true)
- skipBuild("Chosen sanitizer configuration is not supported. Use WEBENGINE_CONFIG+=force_sanitizer_build to force build with the chosen sanitizer configuration.")
- return(false)
-}
-
-defineTest(isSanitizerSupported) {
- sanitizer_combo_supported = true
- sanitize_address {
- asan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- asan_supported = true
- } else:macos:isSanitizerSupportedOnMacOS() {
- asan_supported = true
- }
- !$$asan_supported {
- sanitizer_combo_supported = false
- warning("An address sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++.")
- }
- }
-
- sanitize_memory {
- sanitizer_combo_supported = false
- warning("A memory sanitizer-enabled Qt WebEngine build is not supported.")
- }
-
- sanitize_undefined {
- ubsan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux():CONFIG(release, debug|release):!debug_and_release {
- ubsan_supported = true
- }
- !$$ubsan_supported {
- sanitizer_combo_supported = false
- warning("An undefined behavior sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++ in release mode.")
- }
- }
-
- sanitize_thread {
- tsan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- tsan_supported = true
- }
- !$$tsan_supported {
- sanitizer_combo_supported = false
- warning("A thread sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++.")
- }
- }
-
- $$sanitizer_combo_supported: return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnLinux) {
- isSanitizerLinuxClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnMacOS) {
- isEmpty(QT_APPLE_CLANG_MAJOR_VERSION) {
- QTWEBENGINE_CLANG_IS_APPLE = false
- } else {
- QTWEBENGINE_CLANG_IS_APPLE = true
- }
- $$QTWEBENGINE_CLANG_IS_APPLE:isSanitizerMacOSAppleClangVersionSupported(): return(true)
- else:isSanitizerMacOSClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerMacOSAppleClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Apple Clang version 7.3.0+.
- greaterThan(QT_APPLE_CLANG_MAJOR_VERSION, 7): return(true)
- greaterThan(QT_APPLE_CLANG_MINOR_VERSION, 2): return(true)
-
- warning("Using Apple Clang version $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}.$${QT_APPLE_CLANG_PATCH_VERSION}, but at least Apple Clang version 7.3.0 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerMacOSClangVersionSupported) {
- # Clang sanitizer suppression attributes work from non-apple Clang version 3.7+.
- greaterThan(QT_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QT_CLANG_MINOR_VERSION, 6): return(true)
-
- warning("Using Clang version $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerLinuxClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Clang version 3.7+.
- greaterThan(QT_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QT_CLANG_MINOR_VERSION, 6): return(true)
-
- warning("Using Clang version $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isGCCVersionSupported) {
- # The below will work for gcc 4.7 and up and also match gcc 5
- greaterThan(QT_GCC_MINOR_VERSION, 6):return(true)
- greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
-
- skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.7 is required to build Qt WebEngine.")
- return(false)
-}
-
-defineTest(isDeveloperBuild) {
- qtConfig(private_tests): return(true) # enabled for developer-build
- return(false)
-}
-
-defineTest(isQMLTestSupportApiEnabled) {
- isDeveloperBuild(): return(true)
- contains(QT_BUILD_PARTS, tests): return(true)
- contains(WEBENGINE_CONFIG, testsupport): return(true)
- return(false)
-}
-
-defineTest(isBuildingOnWin32) {
- # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
- # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
- # is building for, not the system's actual architecture.
- PROGRAM_FILES_X86 = $$(ProgramW6432)
- isEmpty(PROGRAM_FILES_X86): return(true)
- return(false)
-}
-
-defineTest(isMinOSXSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- requested_patch = $$3
- isEmpty(requested_patch): requested_patch = 0
- WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
- export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
- isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
- skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
- return(false)
- }
- major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
- minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1)
- patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2)
- isEmpty(patch_version): patch_version = 0
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
-
- return(false)
-}
-
-defineTest(isMinWinSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- WIN_SDK_VERSION = $$(WindowsSDKVersion)
-
- isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
- skipBuild("Could not detect Windows SDK version (\'WindowsSDKVersion\' environment variable is not set).")
- return(false)
- }
-
- # major.0.minor
- major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
- minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true)
-
- return(false)
-}
-
-# Map to the correct target type for gyp
-defineReplace(toGypTargetType) {
- equals(TEMPLATE, "app"):return("executable")
- equals(TEMPLATE, "lib") {
- CONFIG(static): return("static_library")
- return("shared_library")
- }
- return("none")
-}
-
defineReplace(getConfigDir) {
- win32:contains(QMAKE_TARGET.arch, x86_64) {
- CONFIG(release, debug|release):return("Release_x64")
- return("Debug_x64")
- }
-
- CONFIG(release, debug|release):return("Release")
- return("Debug")
+ CONFIG(release, debug|release):return("release")
+ return("debug")
}
defineReplace(getChromiumSrcDir) {
@@ -321,11 +42,6 @@ defineReplace(which) {
return($$out)
}
-defineTest(use?) {
- contains(WEBENGINE_CONFIG, use_$$lower($$1)): return(true)
- return(false)
-}
-
# Returns the unquoted path to the python executable.
defineReplace(pythonPath) {
isEmpty(QMAKE_PYTHON2) {
@@ -362,7 +78,7 @@ defineReplace(gnPath) {
defineReplace(gnArgs) {
linux {
- contains(WEBENGINE_CONFIG, embedded_build): include($$QTWEBENGINE_ROOT/src/core/config/embedded_linux.pri)
+ qtConfig(webengine-embedded-build): include($$QTWEBENGINE_ROOT/src/core/config/embedded_linux.pri)
else: include($$QTWEBENGINE_ROOT/src/core/config/desktop_linux.pri)
}
macos: include($$QTWEBENGINE_ROOT/src/core/config/mac_osx.pri)
@@ -390,6 +106,11 @@ defineReplace(gnOS) {
return(unknown)
}
+defineTest(isDeveloperBuild) {
+ qtConfig(private_tests): return(true) # enabled for developer-build
+ return(false)
+}
+
defineTest(skipBuild) {
skipBuildReason = "$$skipBuildReason $${EOL}$$1"
export(skipBuildReason)
diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
new file mode 100644
index 000000000..bb171f753
--- /dev/null
+++ b/mkspecs/features/platform.prf
@@ -0,0 +1,150 @@
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += webengine-private
+
+defineTest(isQtMinimum) {
+ !equals(QT_MAJOR_VERSION, $$1): return(false)
+ count(ARGS, 1, greaterThan) {
+ lessThan(QT_MINOR_VERSION, $$2): return(false)
+ }
+ return(true)
+}
+
+defineTest(isPlatformSupported) {
+ QT_FOR_CONFIG += gui-private
+ linux {
+ if(!gcc:!clang)|intel_icc {
+ skipBuild("Qt WebEngine on Linux requires clang or GCC.")
+ return(false)
+ }
+ gcc:!clang:!isGCCVersionSupported(): return(false)
+ } else:win32 {
+ winrt {
+ skipBuild("WinRT is not supported.")
+ return(false)
+ }
+ isBuildingOnWin32() {
+ skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.")
+ }
+ !msvc|intel_icl {
+ skipBuild("Qt WebEngine on Windows requires MSVC.")
+ return(false)
+ }
+ !isMinWinSDKVersion(10, 10586): {
+ skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.10586 or newer.")
+ return(false)
+ }
+ !qtConfig(webengine-winversion) {
+ skipBuild("Needs VS 2015 Update 3 with Cumulative Servicing Release or higher")
+ return(false)
+ }
+ } else:osx {
+ lessThan(QMAKE_XCODE_VERSION, 7.3) {
+ skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 7.3 is required to build Qt WebEngine.")
+ return(false)
+ }
+ !clang|intel_icc {
+ skipBuild("Qt WebEngine on macOS requires Clang.")
+ return(false)
+ }
+ # We require macOS 10.11 (darwin version 15.0.0) or newer.
+ darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
+ lessThan(darwin_major_version, 15) {
+ skipBuild("Building Qt WebEngine requires macOS version 10.11 or newer.")
+ return(false)
+ }
+ !isMinOSXSDKVersion(10, 10): {
+ skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.11 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+ return(false)
+ }
+ } else {
+ skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+ return(false)
+ }
+
+ !contains(QT_CONFIG, c++11) {
+ skipBuild("C++11 support is required in order to build chromium.")
+ return(false)
+ }
+ qtConfig(mirclient) {
+ skipBuild("Mir is not yet supported as graphics backend for Qt WebEngine.")
+ return(false)
+ }
+ static {
+ skipBuild("Static builds of QtWebEngine aren't supported.")
+ return(false)
+ }
+ !isArchSupported(): return(false)
+ return(true)
+}
+
+defineTest(isArchSupported) {
+ contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true)
+ contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
+ contains(QT_ARCH, "mips"): return(true)
+# contains(QT_ARCH, "mips64"): return(true)
+
+ skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
+ return(false)
+}
+
+defineTest(isGCCVersionSupported) {
+ # The below will work for gcc 4.7 and up and also match gcc 5
+ greaterThan(QT_GCC_MINOR_VERSION, 6):return(true)
+ greaterThan(QT_GCC_MAJOR_VERSION, 4):return(true)
+
+ skipBuild("Using gcc version "$$QT_GCC_MAJOR_VERSION"."$$QT_GCC_MINOR_VERSION", but at least gcc version 4.7 is required to build Qt WebEngine.")
+ return(false)
+}
+
+defineTest(isBuildingOnWin32) {
+ # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
+ # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
+ # is building for, not the system's actual architecture.
+ PROGRAM_FILES_X86 = $$(ProgramW6432)
+ isEmpty(PROGRAM_FILES_X86): return(true)
+ return(false)
+}
+
+defineTest(isMinOSXSDKVersion) {
+ requested_major = $$1
+ requested_minor = $$2
+ requested_patch = $$3
+ isEmpty(requested_patch): requested_patch = 0
+ WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
+ export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
+ isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
+ skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
+ return(false)
+ }
+ major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
+ minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1)
+ patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2)
+ isEmpty(patch_version): patch_version = 0
+
+ greaterThan(major_version, $$requested_major):return(true)
+ equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
+ equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
+
+ return(false)
+}
+
+defineTest(isMinWinSDKVersion) {
+ requested_major = $$1
+ requested_minor = $$2
+ WIN_SDK_VERSION = $$(WindowsSDKVersion)
+
+ isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
+ skipBuild("Could not detect Windows SDK version (\'WindowsSDKVersion\' environment variable is not set).")
+ return(false)
+ }
+
+ # major.0.minor
+ major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
+ minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
+
+ greaterThan(major_version, $$requested_major):return(true)
+ equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
+ equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true)
+
+ return(false)
+}