From 4dd764a9a005dcd9a7e9643e7337b787519ad113 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 8 Sep 2017 16:52:51 +0200 Subject: Remove unused header include Task-number: QTBUG-63098 Change-Id: Id5fd1f940c928fd74bdc3c202f3e8b18a086c2d0 Reviewed-by: Peter Varga --- src/webengine/render_widget_host_view_qt_delegate_quick.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index 047737254..e9abec02e 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -48,7 +48,6 @@ #include #include #include -#include namespace QtWebEngineCore { -- cgit v1.2.1 From 6347e3195c6934c0f3aa4668a55a285336dd407a Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 13 Sep 2017 11:09:20 +0200 Subject: Move webengine sanitizer option to new configure system Use new configure system to enable sanitizer. Change-Id: I633bc96973b9b9bcd56c4ef03a589e147215dc86 Reviewed-by: Allan Sandfeld Jensen --- configure.json | 10 ++++ configure.pri | 89 ++++++++++++++++++++++++++++++++++++ mkspecs/features/configure.prf | 5 ++ mkspecs/features/functions.prf | 101 ----------------------------------------- 4 files changed, 104 insertions(+), 101 deletions(-) diff --git a/configure.json b/configure.json index 900fbf854..76327d9c1 100644 --- a/configure.json +++ b/configure.json @@ -240,6 +240,10 @@ "icuuc": { "label" : "libxml2 configured with icuuc", "type": "detectIcuuc" + }, + "sanitizer": { + "label" : "sanitizer support", + "type": "isSanitizerSupported" } }, @@ -498,6 +502,12 @@ "label": "libxml2 and libxslt", "condition": "config.unix && libs.libxml2 && tests.icuuc", "output": [ "privateFeature" ] + }, + "webengine-sanitizer" : { + "label": "Sanitizer ", + "autoDetect": "config.sanitizer && tests.sanitizer", + "condition": "config.sanitizer", + "output": [ "privateFeature" ] } }, diff --git a/configure.pri b/configure.pri index 549b1efd0..c88d4964b 100644 --- a/configure.pri +++ b/configure.pri @@ -156,3 +156,92 @@ defineTest(qtConfTest_detectIcuuc) { } return(false) } + +defineTest(qtConfTest_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 + qtLog("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 + qtLog("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 + qtLog("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 + qtLog("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) + + qtLog("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) + + qtLog("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) + + qtLog("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) +} diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index 79b54daba..e21767565 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -53,6 +53,11 @@ defineTest(runConfigure) { qtConfig(embedded): WEBENGINE_CONFIG += reduce_binary_size } + 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); + } + linux { !qtConfig(system-glibc) { skipBuild("A suitable version of libc could not be found. See: https://sourceware.org/bugzilla/show_bug.cgi?id=14898") diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index 7ee471956..ed527d4f2 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -74,7 +74,6 @@ defineTest(isPlatformSupported) { return(false) } !isArchSupported(): return(false) - isSanitizerEnabled():!isSanitizerSupported():!forceSanitizerBuild(): return(false) return(true) } @@ -88,106 +87,6 @@ defineTest(isArchSupported) { 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) -- cgit v1.2.1 From bd97ecd3f617b21fa56a2717abcf76518697b1e3 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 13 Sep 2017 18:10:18 +0200 Subject: Cleanup skipBuild code Move all skipBuild related checks to runConfigure() in configure.prf. Remove some unused functions. Move platform checks to separate prf file. Change-Id: Ia45c837c91c341ed1fbc2e32fc098329da989920 Reviewed-by: Allan Sandfeld Jensen --- mkspecs/features/configure.prf | 31 ++++--- mkspecs/features/functions.prf | 185 +++-------------------------------------- mkspecs/features/platform.prf | 150 +++++++++++++++++++++++++++++++++ qtwebengine.pro | 11 +-- src/buildtools/gn.pro | 6 +- src/buildtools/ninja.pro | 7 +- src/core/gn_run.pro | 6 +- 7 files changed, 192 insertions(+), 204 deletions(-) create mode 100644 mkspecs/features/platform.prf diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index e21767565..ed6fe6c15 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -1,9 +1,28 @@ # Load configure.prf from qtbase first load(configure) load(functions) +load(platform) defineTest(runConfigure) { webengine_successfully_configured: return(true) + + !exists(src/3rdparty/chromium) { + skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.") + return(false) + } + + WSPC = $$find(OUT_PWD, \\s) + !isEmpty(WSPC) { + skipBuild("QtWebEngine cannot be built in a path that contains whitespace characters.") + return(false) + } + + !isPlatformSupported() { + # make sure we have skipBuildReason + isEmpty(skipBuildReason): skipBuild("Unknow error. Platform unspported") + return(false) + } + linux:contains(QT_CONFIG,no-pkg-config) { skipBuild("pkg-config is required") return(false) @@ -46,12 +65,8 @@ defineTest(runConfigure) { !contains(WEBENGINE_CONFIG, use_system_ffmpeg): WEBENGINE_CONFIG += use_bundled_ffmpeg !contains(WEBENGINE_CONFIG, use_system_icu): WEBENGINE_CONFIG += use_bundled_icu - 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 - } + qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code + optimize_size: WEBENGINE_CONFIG += reduce_binary_size sanitizer: !qtConfig(webengine-sanitizer) { skipBuild("Chosen sanitizer configuration is not supported. Use --feature-webengine-sanitizer=yes to force build with the chosen sanitizer configuration.") @@ -119,10 +134,6 @@ defineTest(runConfigure) { } } - win32:!qtConfig(winversion) { - skipBuild("Needs VS 2015 Update 3 with Cumulative Servicing Release or higher") - } - isEmpty(skipBuildReason) { cache(CONFIG, add, $$list(webengine_successfully_configured)) !isEmpty(WEBENGINE_CONFIG) { diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index ed527d4f2..cdb826d98 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -1,176 +1,3 @@ -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, 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(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") @@ -289,6 +116,18 @@ defineReplace(gnOS) { return(unknown) } +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(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..0b0bb6746 --- /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(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) +} diff --git a/qtwebengine.pro b/qtwebengine.pro index 1375bc540..620f451f1 100644 --- a/qtwebengine.pro +++ b/qtwebengine.pro @@ -1,14 +1,7 @@ load(qt_parts) +load(configure) -isPlatformSupported() { - !exists(src/3rdparty/chromium): \ - error("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.") - WSPC = $$find(OUT_PWD, \\s) - !isEmpty(WSPC): \ - error("QtWebEngine cannot be built in a path that contains whitespace characters.") - load(configure) - runConfigure() -} +runConfigure() !isEmpty(skipBuildReason) { SUBDIRS = diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro index db4bbf82c..02d3df652 100644 --- a/src/buildtools/gn.pro +++ b/src/buildtools/gn.pro @@ -3,10 +3,8 @@ option(host_build) !debug_and_release: CONFIG += release -isQtMinimum(5, 8) { - include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) - QT_FOR_CONFIG += webengine-private -} +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private build_pass|!debug_and_release { !qtConfig(system-gn): CONFIG(release, debug|release) { diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro index 1b17c6dfa..c99513f85 100644 --- a/src/buildtools/ninja.pro +++ b/src/buildtools/ninja.pro @@ -2,10 +2,9 @@ TEMPLATE = aux !debug_and_release: CONFIG += release -isQtMinimum(5, 8) { - include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) - QT_FOR_CONFIG += webengine-private -} +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + build_pass|!debug_and_release { !qtConfig(system-ninja): CONFIG(release, debug|release) { diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index ee4e7892e..c565b99a4 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -1,7 +1,5 @@ -isQtMinimum(5, 8) { - include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) - QT_FOR_CONFIG += webengine-private -} +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private TEMPLATE = aux -- cgit v1.2.1 From aaac5fe1f9a1be81b919642e6272967f86fef1a5 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 13 Sep 2017 18:40:23 +0200 Subject: Add UI delegates configure option Change-Id: Ib9d6c8842609c4c410ca65a35fefeab481f71cb2 Reviewed-by: Allan Sandfeld Jensen --- configure.json | 4 ++++ src/src.pro | 5 ++++- src/webenginewidgets/webenginewidgets.pro | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure.json b/configure.json index 76327d9c1..726d151c7 100644 --- a/configure.json +++ b/configure.json @@ -440,6 +440,10 @@ "section": "WebEngine", "output": [ "privateFeature" ] }, + "ui-delegates": { + "label": "UI Delegates", + "output": [ "privateFeature" ] + }, "webrtc": { "label": "WebRTC", "purpose": "Provides WebRTC support.", diff --git a/src/src.pro b/src/src.pro index d9b57615d..d994fc0e9 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = subdirs process.depends = core @@ -30,7 +33,7 @@ isQMLTestSupportApiEnabled() { SUBDIRS += webengine_testsupport_plugin } -!contains(WEBENGINE_CONFIG, no_ui_delegates) { +qtConfig(ui-delegates) { SUBDIRS += webengine/ui \ webengine/ui2 } diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro index ad79c1ef9..10791a6ca 100644 --- a/src/webenginewidgets/webenginewidgets.pro +++ b/src/webenginewidgets/webenginewidgets.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TARGET = QtWebEngineWidgets # For our export macros @@ -42,7 +45,7 @@ HEADERS = \ api/qwebengineview_p.h \ render_widget_host_view_qt_delegate_widget.h -!contains(WEBENGINE_CONFIG, no_ui_delegates) { +qtConfig(ui-delegates) { SOURCES += ui/messagebubblewidget.cpp HEADERS += ui/messagebubblewidget_p.h DEFINES += QT_UI_DELEGATES -- cgit v1.2.1 From d8f18e2b918e2f7c8149d3e6cd1510b27bde7dfd Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 13 Sep 2017 18:42:23 +0200 Subject: Add testsupport to new configure system Change-Id: I123ce22ea3a3d8b7b80c67fa322cb817d924f2e0 Reviewed-by: Allan Sandfeld Jensen --- configure.json | 5 +++++ configure.pri | 5 +++++ mkspecs/features/functions.prf | 12 ------------ src/src.pro | 2 +- src/webengine/webengine.pro | 5 ++++- tests/auto/quick/qmltests/qmltests.pro | 4 ++-- tests/auto/quick/quick.pro | 5 ++++- tests/auto/quick/shared/util.h | 2 +- tests/auto/quick/tests.pri | 5 ++++- 9 files changed, 26 insertions(+), 19 deletions(-) diff --git a/configure.json b/configure.json index 726d151c7..f2cd78343 100644 --- a/configure.json +++ b/configure.json @@ -444,6 +444,11 @@ "label": "UI Delegates", "output": [ "privateFeature" ] }, + "testsupport": { + "label": "Test Support", + "autoDetect": "config.private_tests || call.isTestsInBuildParts", + "output": [ "privateFeature" ] + }, "webrtc": { "label": "WebRTC", "purpose": "Provides WebRTC support.", diff --git a/configure.pri b/configure.pri index c88d4964b..0b6f9fd1b 100644 --- a/configure.pri +++ b/configure.pri @@ -245,3 +245,8 @@ defineTest(isSanitizerLinuxClangVersionSupported) { qtLog("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) } + +defineReplace(qtConfFunc_isTestsInBuildParts) { + contains(QT_BUILD_PARTS, tests): return(true) + return(false) +} diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index cdb826d98..0074a27b0 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -116,18 +116,6 @@ defineReplace(gnOS) { return(unknown) } -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(skipBuild) { skipBuildReason = "$$skipBuildReason $${EOL}$$1" export(skipBuildReason) diff --git a/src/src.pro b/src/src.pro index d994fc0e9..fabead2a0 100644 --- a/src/src.pro +++ b/src/src.pro @@ -26,7 +26,7 @@ use?(spellchecker):!use?(native_spellchecker):!cross_compile { qwebengine_convert_dict.depends = core } -isQMLTestSupportApiEnabled() { +qtConfig(testsupport) { webengine_testsupport_plugin.subdir = webengine/plugin/testsupport webengine_testsupport_plugin.target = sub-webengine-testsupport-plugin webengine_testsupport_plugin.depends = webengine diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index f4bc65edb..ac2727580 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TARGET = QtWebEngine # For our export macros @@ -55,7 +58,7 @@ HEADERS = \ render_widget_host_view_qt_delegate_quickwindow.h \ ui_delegates_manager.h -isQMLTestSupportApiEnabled() { +qtConfig(testsupport) { QT += testlib SOURCES += api/qquickwebenginetestsupport.cpp diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index ceb246dc0..9530e115c 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -100,7 +100,7 @@ OTHER_FILES += \ load(qt_build_paths) DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\" -!isQMLTestSupportApiEnabled() { +!qtConfig(testsupport) { PLUGIN_EXTENSION = .so PLUGIN_PREFIX = lib osx: PLUGIN_PREFIX = .dylib @@ -115,6 +115,6 @@ DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\" warning("QML Test Support API is disabled. This means some QML tests that use Test Support API will fail.") warning("Use the following command to build Test Support module and rebuild WebEngineView API:") - warning("cd $$BUILD_DIR && qmake WEBENGINE_CONFIG+=testsupport -r $$shell_path($$SRC_DIR/qtwebengine.pro) && make -C $$shell_path($$BUILD_DIR/src/webengine) clean && make") + warning("cd $$BUILD_DIR && qmake -r $$shell_path($$SRC_DIR/qtwebengine.pro -- --feature-testsupport=yes) && make -C $$shell_path($$BUILD_DIR/src/webengine) clean && make") warning("After performing the command above make sure QML module \"QtWebEngine.testsupport\" is deployed at $$TESTSUPPORT_MODULE") } diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 8733ccac1..75217c1ec 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = subdirs SUBDIRS += \ @@ -6,7 +9,7 @@ SUBDIRS += \ qquickwebenginedefaultsurfaceformat \ qquickwebengineview -isQMLTestSupportApiEnabled() { +qtConfig(testsupport) { SUBDIRS += \ qmltests \ qquickwebengineviewgraphics diff --git a/tests/auto/quick/shared/util.h b/tests/auto/quick/shared/util.h index 98f19bd49..16456601f 100644 --- a/tests/auto/quick/shared/util.h +++ b/tests/auto/quick/shared/util.h @@ -115,7 +115,7 @@ inline bool waitForViewportReady(QQuickWebEngineView *webEngineView, int timeout Q_UNUSED(timeout) qFatal("Test Support API is disabled. The result is not reliable.\ Use the following command to build Test Support module and rebuild WebEngineView API:\ - qmake -r WEBENGINE_CONFIG+=testsupport && make"); + qmake -r -- --feature-testsupport=yes && make"); return false; #endif } diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri index e00537b9e..15f6517a4 100644 --- a/tests/auto/quick/tests.pri +++ b/tests/auto/quick/tests.pri @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = app CONFIG += testcase @@ -16,7 +19,7 @@ QT += testlib network quick webengine # This define is used by some tests to look up resources in the source tree DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\" -isQMLTestSupportApiEnabled() { +qtConfig(testsupport) { DEFINES += ENABLE_QML_TESTSUPPORT_API } -- cgit v1.2.1 From c9b3baa2e2825df6b06e7366d154341f73d4e326 Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Mon, 18 Sep 2017 15:57:24 +0200 Subject: Replace Setting HideScrollbars by ShowScrollBars Positive options are more intuitive and make for a better API. Task-number: QTBUG-63179 Change-Id: I632ee768dba52554e7d37d9da84661a1d01f1f37 Reviewed-by: Joerg Bornemann Reviewed-by: Leena Miettinen --- src/core/web_engine_settings.cpp | 4 ++-- src/core/web_engine_settings.h | 2 +- src/webengine/api/qquickwebenginesettings.cpp | 16 ++++++++-------- src/webengine/api/qquickwebenginesettings_p.h | 8 ++++---- src/webenginewidgets/api/qwebenginesettings.cpp | 4 ++-- src/webenginewidgets/api/qwebenginesettings.h | 2 +- .../doc/src/qwebenginesettings_lgpl.qdoc | 6 +++--- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index 4c944892a..498c4e799 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -231,7 +231,7 @@ void WebEngineSettings::initDefaults() s_defaultAttributes.insert(PluginsEnabled, false); s_defaultAttributes.insert(FullScreenSupportEnabled, false); s_defaultAttributes.insert(ScreenCaptureEnabled, false); - s_defaultAttributes.insert(HideScrollbars, false); + s_defaultAttributes.insert(ShowScrollBars, true); // The following defaults matches logic in render_view_host_impl.cc // But first we must ensure the WebContext has been initialized QtWebEngineCore::WebEngineContext::current(); @@ -334,7 +334,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p prefs->should_print_backgrounds = testAttribute(PrintElementBackgrounds); prefs->allow_running_insecure_content = testAttribute(AllowRunningInsecureContent); prefs->allow_geolocation_on_insecure_origins = testAttribute(AllowGeolocationOnInsecureOrigins); - prefs->hide_scrollbars = testAttribute(HideScrollbars); + prefs->hide_scrollbars = !testAttribute(ShowScrollBars); // Fonts settings. prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont)); diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index 639d314f3..18963344a 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -85,7 +85,7 @@ public: AllowRunningInsecureContent, AllowGeolocationOnInsecureOrigins, AllowWindowActivationFromJavaScript, - HideScrollbars + ShowScrollBars }; // Must match the values from the public API in qwebenginesettings.h. diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 12d313783..3ce53337c 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -372,13 +372,13 @@ bool QQuickWebEngineSettings::allowWindowActivationFromJavaScript() const } /*! - \qmlproperty bool WebEngineSettings::hideScrollbars + \qmlproperty bool WebEngineSettings::showScrollBars \since QtWebEngine 1.6 - Hides scrollbars. Disabled by default. + Shows scroll bars. Enabled by default. */ -bool QQuickWebEngineSettings::hideScrollbars() const +bool QQuickWebEngineSettings::showScrollBars() const { - return d_ptr->testAttribute(WebEngineSettings::HideScrollbars); + return d_ptr->testAttribute(WebEngineSettings::ShowScrollBars); } /*! @@ -591,12 +591,12 @@ void QQuickWebEngineSettings::setAllowWindowActivationFromJavaScript(bool on) Q_EMIT allowWindowActivationFromJavaScriptChanged(); } -void QQuickWebEngineSettings::setHideScrollbars(bool on) +void QQuickWebEngineSettings::setShowScrollBars(bool on) { - bool wasOn = d_ptr->testAttribute(WebEngineSettings::HideScrollbars); - d_ptr->setAttribute(WebEngineSettings::HideScrollbars, on); + bool wasOn = d_ptr->testAttribute(WebEngineSettings::ShowScrollBars); + d_ptr->setAttribute(WebEngineSettings::ShowScrollBars, on); if (wasOn != on) - Q_EMIT hideScrollbarsChanged(); + Q_EMIT showScrollBarsChanged(); } void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings) diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h index da838f52f..a8b11c769 100644 --- a/src/webengine/api/qquickwebenginesettings_p.h +++ b/src/webengine/api/qquickwebenginesettings_p.h @@ -87,7 +87,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject { Q_PROPERTY(bool allowRunningInsecureContent READ allowRunningInsecureContent WRITE setAllowRunningInsecureContent NOTIFY allowRunningInsecureContentChanged REVISION 3 FINAL) Q_PROPERTY(bool allowGeolocationOnInsecureOrigins READ allowGeolocationOnInsecureOrigins WRITE setAllowGeolocationOnInsecureOrigins NOTIFY allowGeolocationOnInsecureOriginsChanged REVISION 4 FINAL) Q_PROPERTY(bool allowWindowActivationFromJavaScript READ allowWindowActivationFromJavaScript WRITE setAllowWindowActivationFromJavaScript NOTIFY allowWindowActivationFromJavaScriptChanged REVISION 5 FINAL) - Q_PROPERTY(bool hideScrollbars READ hideScrollbars WRITE setHideScrollbars NOTIFY hideScrollbarsChanged REVISION 5 FINAL) + Q_PROPERTY(bool showScrollBars READ showScrollBars WRITE setShowScrollBars NOTIFY showScrollBarsChanged REVISION 5 FINAL) public: ~QQuickWebEngineSettings(); @@ -116,7 +116,7 @@ public: bool allowRunningInsecureContent() const; bool allowGeolocationOnInsecureOrigins() const; bool allowWindowActivationFromJavaScript() const; - bool hideScrollbars() const; + bool showScrollBars() const; void setAutoLoadImages(bool on); void setJavascriptEnabled(bool on); @@ -142,7 +142,7 @@ public: void setAllowRunningInsecureContent(bool on); void setAllowGeolocationOnInsecureOrigins(bool on); void setAllowWindowActivationFromJavaScript(bool on); - void setHideScrollbars(bool on); + void setShowScrollBars(bool on); signals: void autoLoadImagesChanged(); @@ -169,7 +169,7 @@ signals: Q_REVISION(3) void allowRunningInsecureContentChanged(); Q_REVISION(4) void allowGeolocationOnInsecureOriginsChanged(); Q_REVISION(5) void allowWindowActivationFromJavaScriptChanged(); - Q_REVISION(5) void hideScrollbarsChanged(); + Q_REVISION(5) void showScrollBarsChanged(); private: explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0); diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp index 439e00590..1def61cb6 100644 --- a/src/webenginewidgets/api/qwebenginesettings.cpp +++ b/src/webenginewidgets/api/qwebenginesettings.cpp @@ -99,8 +99,8 @@ static WebEngineSettings::Attribute toWebEngineAttribute(QWebEngineSettings::Web return WebEngineSettings::AllowGeolocationOnInsecureOrigins; case QWebEngineSettings::AllowWindowActivationFromJavaScript: return WebEngineSettings::AllowWindowActivationFromJavaScript; - case QWebEngineSettings::HideScrollbars: - return WebEngineSettings::HideScrollbars; + case QWebEngineSettings::ShowScrollBars: + return WebEngineSettings::ShowScrollBars; default: return WebEngineSettings::UnsupportedInCoreSettings; diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h index 1857e5228..470609227 100644 --- a/src/webenginewidgets/api/qwebenginesettings.h +++ b/src/webenginewidgets/api/qwebenginesettings.h @@ -91,7 +91,7 @@ public: AllowRunningInsecureContent, AllowGeolocationOnInsecureOrigins, AllowWindowActivationFromJavaScript, - HideScrollbars + ShowScrollBars }; enum FontSize { diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index e6a94281e..d3b16a935 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -165,9 +165,9 @@ \value AllowWindowActivationFromJavaScript Allows the window.focus() method in JavaScript. Disallowed by default. (Added in Qt 5.10) - \value HideScrollbars - Hides scrollbars. - Disabled by default. (Added in Qt 5.10) + \value ShowScrollBars + Shows scroll bars. + Enabled by default. (Added in Qt 5.10) */ diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 09d4f0f51..837481fad 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -3538,7 +3538,7 @@ void tst_QWebEnginePage::scrollPosition() void tst_QWebEnginePage::scrollbarsOff() { QWebEngineView view; - view.page()->settings()->setAttribute(QWebEngineSettings::HideScrollbars, true); + view.page()->settings()->setAttribute(QWebEngineSettings::ShowScrollBars, false); QString html("" "
" -- cgit v1.2.1 From 1691d2298a8adf511ed95d5aa5d4410adcbdd1e3 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 13 Sep 2017 19:12:38 +0200 Subject: Remove WEBENGINE_CONFIG from configure Do not store flags in qmake.cache with WEBENGINE_CONFIG. Use directly qtConfig values insted. This makes configuration more consistent, simplifies handling and avoids passing values from qtConfig to WEBENIGNE_CONFIG, which then were passed to gn. [ChangeLog] Removing WEBENGINE_CONFIG from qtwebengine configure Change-Id: I1a773fb4bff6d67ad75c237d044998051d92ab51 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Qt CI Bot --- configure.json | 11 ++-- .../webenginewidgets/spellchecker/spellchecker.pro | 5 +- examples/webenginewidgets/webenginewidgets.pro | 14 +++-- mkspecs/features/configure.prf | 66 +--------------------- mkspecs/features/functions.prf | 7 +-- src/core/config/common.pri | 18 +++--- src/core/config/desktop_linux.pri | 4 -- src/core/config/embedded_linux.pri | 4 -- src/core/config/linux.pri | 53 ++++++++--------- src/core/config/mac_osx.pri | 6 +- src/core/core_chromium.pri | 16 +++--- src/core/core_generator.pro | 3 + src/core/core_module.pro | 7 ++- src/src.pro | 2 +- src/webengine/webengine.pro | 4 +- src/webenginewidgets/webenginewidgets.pro | 9 +-- .../qquickwebengineview/qquickwebengineview.pro | 2 +- .../auto/widgets/qwebenginepage/qwebenginepage.pro | 2 +- tests/auto/widgets/tests.pri | 3 + tests/auto/widgets/widgets.pro | 7 ++- 20 files changed, 89 insertions(+), 154 deletions(-) diff --git a/configure.json b/configure.json index f2cd78343..c89012352 100644 --- a/configure.json +++ b/configure.json @@ -11,7 +11,7 @@ "webengine-icu": { "type": "enum", "name": "system-icu", "values": { "system": "yes", "qt": "no" } }, "ffmpeg": { "type": "enum", "name": "system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, "opus": { "type": "enum", "name": "system-opus", "values": { "system": "yes", "qt": "no" } }, - "webp": { "type": "enum", "name": "system-webp", "values": { "system": "yes", "qt": "no" } }, + "webp": { "type": "enum", "name": "system-libwebp", "values": { "system": "yes", "qt": "no" } }, "pepper-plugins": "boolean", "printing-and-pdf": "boolean", "proprietary-codecs": "boolean", @@ -436,8 +436,9 @@ "native-spellchecker": { "label": "Native Spellchecker", "purpose": "Provides a native spellchecker.", - "condition": "config.macos", "section": "WebEngine", + "autoDetect": false, + "condition": "config.macos && features.spellchecker", "output": [ "privateFeature" ] }, "ui-delegates": { @@ -461,7 +462,7 @@ "condition": "config.unix && !config.darwin && libs.nss", "output": [ "privateFeature" ] }, - "system-webp": { + "system-libwebp": { "label": "libwebp, libwebpmux and libwebpdemux", "autoDetect": "config.unix", "condition": "libs.webp", @@ -476,7 +477,7 @@ "system-ffmpeg": { "label": "ffmpeg", "autoDetect": false, - "condition": "libs.ffmpeg && features.system-opus && features.system-webp", + "condition": "libs.ffmpeg && features.system-opus && features.system-libwebp", "output": [ "privateFeature" ] }, "system-icu": { @@ -572,7 +573,7 @@ "entries": [ "system-re2", "system-icu", - "system-webp", + "system-libwebp", "system-opus", "system-ffmpeg", "system-libvpx", diff --git a/examples/webenginewidgets/spellchecker/spellchecker.pro b/examples/webenginewidgets/spellchecker/spellchecker.pro index c6031a36d..4c7ad2c36 100644 --- a/examples/webenginewidgets/spellchecker/spellchecker.pro +++ b/examples/webenginewidgets/spellchecker/spellchecker.pro @@ -1,9 +1,12 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = app TARGET = spellchecker QT += webenginewidgets CONFIG += c++11 -contains(WEBENGINE_CONFIG, use_native_spellchecker) { +qtConfig(native-spellchecker) { error("Spellcheck example can not be built when using native OS dictionaries.") } diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro index cb7c8aa22..63deb5854 100644 --- a/examples/webenginewidgets/webenginewidgets.pro +++ b/examples/webenginewidgets/webenginewidgets.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE=subdirs SUBDIRS += \ @@ -12,10 +15,9 @@ SUBDIRS += \ qtHaveModule(positioning): SUBDIRS += maps -contains(WEBENGINE_CONFIG, use_spellchecker):!cross_compile { - !contains(WEBENGINE_CONFIG, use_native_spellchecker) { - SUBDIRS += spellchecker - } else { - message("Spellcheck example will not be built because it depends on usage of Hunspell dictionaries.") - } +qtConfig(spellchecker):!qtConfig(native-spellchecker):!cross_compile { + SUBDIRS += spellchecker +} else { + message("Spellcheck example will not be built because it depends on usage of Hunspell dictionaries.") } + diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index ed6fe6c15..ed9882735 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -4,7 +4,6 @@ load(functions) load(platform) defineTest(runConfigure) { - webengine_successfully_configured: return(true) !exists(src/3rdparty/chromium) { skipBuild("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.") @@ -48,26 +47,6 @@ defineTest(runConfigure) { return(false) } - 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 - - qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code - optimize_size: WEBENGINE_CONFIG += reduce_binary_size - 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); @@ -93,9 +72,7 @@ defineTest(runConfigure) { } } - WEBENGINE_CONFIG += use_nss - - !contains(WEBENGINE_CONFIG, embedded_build): qtConfig(xcb) { + !qtConfig(embedded): qtConfig(xcb) { for(package, $$list("libdrm xcomposite xcursor xi xrandr xtst")) { !qtConfig(system-$$package) { skipBuild("A suitable version of $$package could not be found.") @@ -103,47 +80,6 @@ defineTest(runConfigure) { } } } - - # Fix me: mamke system-png a public feature in gui - qtConfig(system-png): qtConfig(webengine-system-png) { - WEBENGINE_CONFIG += use_system_libpng - } - # Fix me: make system-harfbuzz a public feautre in gui - qtConfig(system-harfbuzz): qtConfig(webengine-system-harfbuzz) { - WEBENGINE_CONFIG += use_system_harfbuzz - } - qtConfig(system-glib) { - WEBENGINE_CONFIG += use_glib - } - qtConfig(system-minizip) { - WEBENGINE_CONFIG += use_system_minizip - } - qtConfig(system-zlib) { - WEBENGINE_CONFIG += use_system_zlib - } - qtConfig(system-libxml2) { - WEBENGINE_CONFIG += use_system_libxslt use_system_libxml2 - } - - for(package, $$list("libevent jsoncpp protobuf libvpx libsrtp snappy")) { - qtConfig(system-$$package) { - WEBENGINE_CONFIG += use_system_$$package - } else { - WEBENGINE_CONFIG += use_bundled_$$package - } - } - } - - isEmpty(skipBuildReason) { - cache(CONFIG, add, $$list(webengine_successfully_configured)) - !isEmpty(WEBENGINE_CONFIG) { - cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG)) - export(WEBENGINE_CONFIG) - } - } - - macos:qtConfig(native-spellchecker) { - WEBENGINE_CONFIG+=use_native_spellchecker } } diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index 0074a27b0..3f0d64ba5 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -47,11 +47,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) { @@ -88,7 +83,7 @@ defineReplace(gnPath) { defineReplace(gnArgs) { linux { - contains(WEBENGINE_CONFIG, embedded_build): include($$QTWEBENGINE_ROOT/src/core/config/embedded_linux.pri) + qtConfig(embedded): 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) diff --git a/src/core/config/common.pri b/src/core/config/common.pri index ce7364ff9..2aa3c614d 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -13,37 +13,33 @@ gn_args += \ treat_warnings_as_errors=false \ enable_swiftshader=false -use?(printing) { +qtConfig(printing-and-pdf) { gn_args += enable_basic_printing=true enable_print_preview=true -} else { - gn_args += enable_basic_printing=false enable_print_preview=false -} - -use?(pdf) { gn_args += enable_pdf=true } else { + gn_args += enable_basic_printing=false enable_print_preview=false gn_args += enable_pdf=false } -use?(pepper_plugins) { +qtConfig(pepper-plugins) { gn_args += enable_plugins=true enable_widevine=true } else { gn_args += enable_plugins=false enable_widevine=false } -use?(spellchecker) { +qtConfig(spellchecker) { gn_args += enable_spellcheck=true } else { gn_args += enable_spellcheck=false } -use?(webrtc) { +qtConfig(webrtc) { gn_args += enable_webrtc=true } else { gn_args += enable_webrtc=false } -use?(proprietary_codecs): gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\" +qtConfig(proprietary-codecs): gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\" CONFIG(release, debug|release) { force_debug_info { @@ -63,4 +59,4 @@ CONFIG(debug, debug|release) { !v8base_debug: gn_args += remove_v8base_debug_symbols=true # Compiling with -Os makes a huge difference in binary size -contains(WEBENGINE_CONFIG, reduce_binary_size): gn_args += optimize_for_size=true +optimize_size: gn_args += optimize_for_size=true diff --git a/src/core/config/desktop_linux.pri b/src/core/config/desktop_linux.pri index 4d3f923e1..70f1cf81e 100644 --- a/src/core/config/desktop_linux.pri +++ b/src/core/config/desktop_linux.pri @@ -5,8 +5,4 @@ gn_args += \ enable_session_service=false \ toolkit_views=false -use?(icecc) { - gn_args += use_debug_fission=false -} - !use_gold_linker: gn_args += use_gold=false diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri index e48f1fc12..8d9f09deb 100644 --- a/src/core/config/embedded_linux.pri +++ b/src/core/config/embedded_linux.pri @@ -11,7 +11,3 @@ gn_args += \ ozone_platform_external=true \ ozone_platform=\"qt\" \ toolkit_views=false - -use?(icecc) { - gn_args += use_debug_fission=false -} diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index c0f2f6289..fae157060 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -8,17 +8,10 @@ gn_args += \ use_gio=false \ use_gnome_keyring=false \ use_kerberos=false \ - linux_use_bundled_binutils=false + linux_use_bundled_binutils=false \ + use_nss_certs=true \ + use_openssl_certs=false -use?(nss) { - gn_args += \ - use_nss_certs=true \ - use_openssl_certs=false -} else { - gn_args += \ - use_nss_certs=false \ - use_openssl_certs=true -} gcc:!clang: greaterThan(QT_GCC_MAJOR_VERSION, 5): gn_args += no_delete_null_pointer_checks=true clang { @@ -119,15 +112,20 @@ host_build { # Strip '>2 /dev/null' from $$pkgConfigExecutable() PKGCONFIG = $$first($$list($$pkgConfigExecutable())) gn_args += pkg_config=\"$$PKGCONFIG\" - gn_args += "host_pkg_config=\"pkg-config\"" + gn_args += host_pkg_config=\"pkg-config\" } - qtConfig(system-zlib): use?(system_minizip): gn_args += use_system_zlib=true use_system_minizip=true - use?(system_libpng): gn_args += use_system_libpng=true + qtConfig(system-zlib): qtConfig(system-minizip): gn_args += use_system_zlib=true use_system_minizip=true + + # FIXME: make system-png a public feature in gui + qtConfig(system-png): qtConfig(webengine-system-png): gn_args += use_system_libpng=true + qtConfig(system-jpeg): gn_args += use_system_libjpeg=true qtConfig(system-freetype): gn_args += use_system_freetype=true - use?(system_harfbuzz): gn_args += use_system_harfbuzz=true - !use?(glib): gn_args += use_glib=false + + # FIXME: make system-harfbuzz a public feautre in gui + qtConfig(system-harfbuzz): qtConfig(webengine-system-harfbuzz): gn_args += use_system_harfbuzz=true + qtConfig(system-glib): gn_args += use_glib=false qtConfig(pulseaudio) { gn_args += use_pulseaudio=true } else { @@ -143,15 +141,18 @@ host_build { !packagesExist(libpci): gn_args += use_libpci=false !packagesExist(xscrnsaver): gn_args += use_xscrnsaver=false - use?(system_libevent): gn_args += use_system_libevent=true - use?(system_libwebp): gn_args += use_system_libwebp=true - use?(system_libxslt): gn_args += use_system_libxml=true use_system_libxslt=true - #use?(system_jsoncpp): gn_args += use_system_jsoncpp=true - use?(system_opus): gn_args += use_system_opus=true - use?(system_snappy): gn_args += use_system_snappy=true - use?(system_libvpx): gn_args += use_system_libvpx=true - use?(system_icu): gn_args += use_system_icu=true icu_use_data_file=false - use?(system_ffmpeg): gn_args += use_system_ffmpeg=true - use?(system_re2): gn_args += use_system_re2=true - #use?(system_protobuf): gn_args += use_system_protobuf=true + qtConfig(system-libevent): gn_args += use_system_libevent=true + qtConfig(system-libwebp): gn_args += use_system_libwebp=true + qtConfig(system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true + qtConfig(system-opus): gn_args += use_system_opus=true + qtConfig(system-snappy): gn_args += use_system_snappy=true + qtConfig(system-libvpx): gn_args += use_system_libvpx=true + qtConfig(system-icu): gn_args += use_system_icu=true icu_use_data_file=false + qtConfig(system-ffmpeg): gn_args += use_system_ffmpeg=true + qtConfig(system-re2): gn_args += use_system_re2=true + + # FIXME: + #qtConfig(system-protobuf): gn_args += use_system_protobuf=true + #qtConfig(system-jsoncpp): gn_args += use_system_jsoncpp=true + #qtConfig(system-libsrtp: gn_args += use_system_libsrtp=true } diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri index ddb397565..57f301f18 100644 --- a/src/core/config/mac_osx.pri +++ b/src/core/config/mac_osx.pri @@ -32,9 +32,9 @@ gn_args += \ toolkit_views=false \ use_external_popup_menu=false -use?(spellchecker) { - use?(native_spellchecker): gn_args += use_browser_spellchecker=true +qtConfig(spellchecker) { + qtConfig(native-spellchecker): gn_args += use_browser_spellchecker=true else: gn_args += use_browser_spellchecker=false } else { - macos: gn_args += use_browser_spellchecker=false + gn_args += use_browser_spellchecker=false } diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri index b76469833..71f74f51a 100644 --- a/src/core/core_chromium.pri +++ b/src/core/core_chromium.pri @@ -28,7 +28,7 @@ RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc # Assume that we want mobile touch and low-end hardware behaviors # whenever we are cross compiling. -contains(WEBENGINE_CONFIG, embedded_build): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES +qtConfig(embedded): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES qtConfig(egl): CONFIG += egl @@ -187,13 +187,8 @@ HEADERS = \ web_engine_settings.h \ web_event_factory.h +qtConfig(pepper-plugins) { -use?(pdf) { - SOURCES += pdfium_document_wrapper_qt.cpp - HEADERS += pdfium_document_wrapper_qt.h -} - -use?(pepper_plugins) { SOURCES += \ renderer_host/pepper/pepper_flash_browser_host_qt.cpp \ renderer_host/pepper/pepper_host_factory_qt.cpp \ @@ -209,7 +204,8 @@ use?(pepper_plugins) { renderer/pepper/pepper_renderer_host_factory_qt.h } -use?(printing) { +qtConfig(printing-and-pdf) { + SOURCES += \ printing_message_filter_qt.cpp \ print_view_manager_base_qt.cpp \ @@ -221,6 +217,10 @@ use?(printing) { print_view_manager_base_qt.h \ print_view_manager_qt.h \ renderer/print_web_view_helper_delegate_qt.h + + # pdf sources + SOURCES += pdfium_document_wrapper_qt.cpp + HEADERS += pdfium_document_wrapper_qt.h } contains(QT_CONFIG, opengl) { diff --git a/src/core/core_generator.pro b/src/core/core_generator.pro index 916c211f9..cbf126dda 100644 --- a/src/core/core_generator.pro +++ b/src/core/core_generator.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + include(core_gn_config.pri) TEMPLATE = lib diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 1a5b66867..55b20cda2 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + MODULE = webenginecore include(core_common.pri) @@ -110,7 +113,7 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat resources.path = $$[QT_INSTALL_DATA]/resources INSTALLS += locales resources - !use?(system_icu) { + !qtConfig(system-icu) { icu.CONFIG += no_check_exist icu.path = $$[QT_INSTALL_DATA]/resources INSTALLS += icu @@ -122,7 +125,7 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat # Copy essential files to the qtbase build directory for non-prefix builds # - !use?(system_icu) { + !qtConfig(system-icu) { COPIES += icu } diff --git a/src/src.pro b/src/src.pro index fabead2a0..1cd23f9fa 100644 --- a/src/src.pro +++ b/src/src.pro @@ -20,7 +20,7 @@ SUBDIRS += buildtools \ plugins -use?(spellchecker):!use?(native_spellchecker):!cross_compile { +qtConfig(spellchecker):!qtConfig(native-spellchecker):!cross_compile { SUBDIRS += qwebengine_convert_dict qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict qwebengine_convert_dict.depends = core diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index ac2727580..4b2170cbc 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -67,11 +67,11 @@ qtConfig(testsupport) { DEFINES += ENABLE_QML_TESTSUPPORT_API } -contains(WEBENGINE_CONFIG, use_spellchecker) { +qtConfig(spellchecker) { DEFINES += ENABLE_SPELLCHECK } -use?(pdf) { +qtConfig(printing-and-pdf) { DEFINES += ENABLE_PDF } diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro index 10791a6ca..a5c22e7be 100644 --- a/src/webenginewidgets/webenginewidgets.pro +++ b/src/webenginewidgets/webenginewidgets.pro @@ -51,17 +51,14 @@ qtConfig(ui-delegates) { DEFINES += QT_UI_DELEGATES } -contains(WEBENGINE_CONFIG, use_spellchecker) { +qtConfig(spellchecker) { DEFINES += ENABLE_SPELLCHECK } -use?(printing) { +qtConfig(printing-and-pdf) { DEFINES += ENABLE_PRINTING - QT += printsupport -} - -use?(pdf) { DEFINES += ENABLE_PDF + QT += printsupport } load(qt_module) diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro index df9b3e1b7..0f62ec21d 100644 --- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro +++ b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro @@ -5,7 +5,7 @@ QT_PRIVATE += webengine-private gui-private HEADERS += ../shared/util.h -use?(pdf) { +qtConfig(printing-and-pdf) { DEFINES += ENABLE_PDF } diff --git a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro b/tests/auto/widgets/qwebenginepage/qwebenginepage.pro index e0765736e..a2dbd4d70 100644 --- a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro +++ b/tests/auto/widgets/qwebenginepage/qwebenginepage.pro @@ -1,4 +1,4 @@ include(../tests.pri) QT *= core-private -contains(WEBENGINE_CONFIG, use_pdf): DEFINES+=QWEBENGINEPAGE_PDFPRINTINGENABLED +qtConfig(printing-and-pdf): DEFINES+=QWEBENGINEPAGE_PDFPRINTINGENABLED diff --git a/tests/auto/widgets/tests.pri b/tests/auto/widgets/tests.pri index d77cd5af5..dc0461e2b 100644 --- a/tests/auto/widgets/tests.pri +++ b/tests/auto/widgets/tests.pri @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = app CONFIG += testcase diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 441eea0fa..60e5cc11f 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -1,3 +1,6 @@ +include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) +QT_FOR_CONFIG += webengine-private + TEMPLATE = subdirs SUBDIRS += \ @@ -14,8 +17,8 @@ SUBDIRS += \ qwebenginesettings \ qwebengineview -contains(WEBENGINE_CONFIG, use_spellchecker):!cross_compile { - !contains(WEBENGINE_CONFIG, use_native_spellchecker) { +qtConfig(spellchecker):!cross_compile { + !qtConfig(native-spellchecker) { SUBDIRS += qwebenginespellcheck } else { message("Spellcheck test will not be built because it depends on usage of Hunspell dictionaries.") -- cgit v1.2.1 From 24a72329a69f82881bf2624cb76b31f798ca08b3 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 19 Sep 2017 15:58:27 +0200 Subject: Fix pkg-config call in icu test The call had the side effect of generating extra pkg-config-wrapper.sh in root of the build. Use different pkg-config call. Change-Id: I8335ae55547272924802f3903ce6bba903389b62 Reviewed-by: Allan Sandfeld Jensen --- configure.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.pri b/configure.pri index 0b6f9fd1b..1765e32e3 100644 --- a/configure.pri +++ b/configure.pri @@ -148,7 +148,7 @@ defineTest(qtConfTest_embedded) { } defineTest(qtConfTest_detectIcuuc) { - pkgConfig = $$first($$list($$pkgConfigExecutable())) + pkgConfig = $$qtConfPkgConfig() !isEmpty(pkgConfig) { qtRunLoggedCommand("$$pkgConfig --libs --static libxml-2.0", xmllibs) contains(xmllibs,".*-licuuc.*"):return(true) -- cgit v1.2.1 From 89bc0ad2d10f2c866a111965cd3805b70a9fd728 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 19 Sep 2017 16:12:51 +0200 Subject: Fix system-harfbuzz and system-png detection Import gui-private to check for system-png and system-harfbuzz. Change-Id: I26fe98ce3de1f6af8015228260e8ef74952e816e Reviewed-by: Allan Sandfeld Jensen --- configure.json | 5 +++-- src/core/config/linux.pri | 9 ++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.json b/configure.json index c89012352..3210c60fb 100644 --- a/configure.json +++ b/configure.json @@ -1,6 +1,7 @@ { "module": "webengine", "depends": [ + "gui-private", "printsupport" ], @@ -290,7 +291,7 @@ }, "webengine-system-harfbuzz": { "label": "harfbuzz", - "condition": "libs.harfbuzz", + "condition": "config.unix && features.system-harfbuzz && libs.harfbuzz", "output": [ "privateFeature" ] }, "system-glib" : { @@ -325,7 +326,7 @@ }, "webengine-system-png" : { "label": "png", - "condition": "config.unix && libs.png", + "condition": "config.unix && features.system-png && libs.png", "output": [ "privateFeature" ] }, "python2": { diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index fae157060..a2361b02f 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -116,15 +116,10 @@ host_build { } qtConfig(system-zlib): qtConfig(system-minizip): gn_args += use_system_zlib=true use_system_minizip=true - - # FIXME: make system-png a public feature in gui - qtConfig(system-png): qtConfig(webengine-system-png): gn_args += use_system_libpng=true - + qtConfig(webengine-system-png): gn_args += use_system_libpng=true qtConfig(system-jpeg): gn_args += use_system_libjpeg=true qtConfig(system-freetype): gn_args += use_system_freetype=true - - # FIXME: make system-harfbuzz a public feautre in gui - qtConfig(system-harfbuzz): qtConfig(webengine-system-harfbuzz): gn_args += use_system_harfbuzz=true + qtConfig(webengine-system-harfbuzz): gn_args += use_system_harfbuzz=true qtConfig(system-glib): gn_args += use_glib=false qtConfig(pulseaudio) { gn_args += use_pulseaudio=true -- cgit v1.2.1 From 30788d4919c26957abdae078418630647ebe7e8f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 19 Sep 2017 13:55:46 +0200 Subject: Fix native-spellchecker compilation on mac Set correct header. Change-Id: I3bbe0e79afae0e50c88e363079475f872a8bb6a2 Reviewed-by: Kai Koehne --- src/core/content_browser_client_qt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index a087940ef..97d3ad6bb 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -46,7 +46,7 @@ #if BUILDFLAG(ENABLE_SPELLCHECK) #include "chrome/browser/spellchecker/spellcheck_message_filter.h" #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) -#include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" +#include "components/spellcheck/browser/spellcheck_message_filter_platform.h" #endif #endif #include "content/browser/renderer_host/render_view_host_delegate.h" -- cgit v1.2.1 From 9fdc847c639ef7060a13b10d9fe704e40357a0a8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 Sep 2017 15:48:24 +0200 Subject: Simplify binary paths These old names were for gyp, and are not needed for gn, so we can instead use the same path names Qt would use. Change-Id: I423c2a04df6740ebba84f8c670490dbcf59c3ca7 Reviewed-by: Joerg Bornemann --- mkspecs/features/functions.prf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index 3f0d64ba5..7e801bcfa 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -1,11 +1,6 @@ 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) { -- cgit v1.2.1