From e453be82f510303e41a24c0093bd03c7f8374f75 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 25 Apr 2017 12:46:36 +0200 Subject: Make python2 usage more robust After configuring Qt there will be an error message if a suitable python version could not be found. Add python2 configure test that - first looks for python2 in PATH - then looks for python in PATH - checks the Python version - stores the result in QMAKE_PYTHON2 Use $$QMAKE_PYTHON2 everywhere where we call python. Pass $$QMAKE_PYTHON2 to gn for its exec_script feature. Task-number: QTBUG-60164 Change-Id: I33de1273cbd20a787b3c8889d35280784dbcd5ae Reviewed-by: Oswald Buddenhagen Reviewed-by: Michal Klocek --- configure.json | 20 +++++++++++++++ configure.pri | 41 ++++++++++++++++++++++++++++++ src/buildtools/gn.pro | 2 +- src/buildtools/ninja.pro | 2 +- src/core/gn_run.pro | 3 ++- src/webengine/webengine.pro | 3 ++- tools/qmake/mkspecs/features/functions.prf | 39 ++++++++++++++-------------- 7 files changed, 86 insertions(+), 24 deletions(-) diff --git a/configure.json b/configure.json index 62b56bbb1..605807a36 100644 --- a/configure.json +++ b/configure.json @@ -58,6 +58,11 @@ }, "tests" : { + "python2": { + "label": "Python 2", + "type": "detectPython2", + "log": "location" + }, "ninja": { "label": "system ninja", "type": "detectNinja" @@ -73,6 +78,13 @@ }, "features": { + "python2": { + "label": "Python 2", + "condition": "tests.python2", + "output": [ + { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.python2.location" } + ] + }, "embedded": { "label": "Embedded build", "condition": "config.unix", @@ -157,6 +169,14 @@ } }, + "report": [ + { + "type": "warning", + "condition": "!features.python2", + "message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine." + } + ], + "summary": [ { "section": "Qt WebEngine", diff --git a/configure.pri b/configure.pri index 23f31686e..ce36642bb 100644 --- a/configure.pri +++ b/configure.pri @@ -1,5 +1,46 @@ equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe +defineTest(isPythonVersionSupported) { + python = $$system_quote($$system_path($$1)) + python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"') + python_version ~= s/[()]//g + python_version = $$split(python_version, ',') + python_major_version = $$first(python_version) + greaterThan(python_major_version, 2) { + qtLog("Python version 3 is not supported by Chromium.") + return(false) + } + python_minor_version = $$member(python_version, 1) + python_patch_version = $$member(python_version, 2) + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) + qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") + return(false) +} + +defineTest(qtConfTest_detectPython2) { + python = $$qtConfFindInPath("python2") + isEmpty(python) { + qtLog("'python2' not found in PATH. Checking for 'python'.") + python = $$qtConfFindInPath("python$$EXE_SUFFIX") + } + isEmpty(python) { + qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.") + return(false) + } + !isPythonVersionSupported($$python) { + qtLog("A suitable Python 2 executable could not be located.") + return(false) + } + + # Make tests.python2.location available in configure.json. + $${1}.location = $$clean_path($$python) + export($${1}.location) + $${1}.cache += location + export($${1}.cache) + + return(true) +} + defineTest(qtConfTest_detectNinja) { ninja = $$qtConfFindInPath("ninja$$EXE_SUFFIX") !isEmpty(ninja) { diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro index 092888e0e..f8f8b20da 100644 --- a/src/buildtools/gn.pro +++ b/src/buildtools/gn.pro @@ -14,7 +14,7 @@ defineReplace(buildGn) { gn_bootstrap = $$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py, $$src_3rd_party_dir)) gn_args = $$system_quote($$gn_args) gn_configure = $$system_quote($$gn_bootstrap) --shadow --gn-gen-args=$$gn_args $$ninja_path - !system("cd $$system_quote($$system_path($$dirname(out))) && python $$gn_configure") { + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$gn_configure") { error("GN build error!") } } diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro index c391d6e84..0a01f1f4e 100644 --- a/src/buildtools/ninja.pro +++ b/src/buildtools/ninja.pro @@ -8,7 +8,7 @@ defineReplace(buildNinja) { mkpath($$dirname(out)) src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir))) - !system("cd $$system_quote($$system_path($$dirname(out))) && python $$ninja_configure --bootstrap") { + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") { error("NINJA build error!") } } diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index 07635d04c..b6966a51d 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -51,7 +51,8 @@ build_pass|!debug_and_release { gn_args = $$shell_quote($$gn_args) gn_src_root = $$shell_quote($$shell_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) gn_build_root = $$shell_quote($$shell_path($$OUT_PWD/$$getConfigDir())) - $$runGn($$gn_binary gen $$gn_build_root --args=$$gn_args --root=$$gn_src_root) + gn_python = "--script-executable=$$pythonPathForSystem()" + $$runGn($$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root) runninja.commands = $$NINJA \$\(NINJAFLAGS\) -C $$gn_build_root QtWebEngineCore QMAKE_EXTRA_TARGETS += runninja diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index 27239225b..5ac93c9a7 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -71,9 +71,10 @@ use?(pdf) { } !build_pass { + python = $$pythonPathForShell() chromium_attributions.commands = \ cd $$shell_quote($$shell_path($$PWD/../3rdparty)) && \ - python chromium/tools/licenses.py \ + $$python chromium/tools/licenses.py \ --file-template ../../tools/about_credits.tmpl \ --entry-template ../../tools/about_credits_entry.tmpl credits \ > $$shell_quote($$shell_path($$OUT_PWD/chromium_attributions.qdoc)) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index ed1133037..eb421f8b5 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -86,7 +86,6 @@ defineTest(isPlatformSupported) { skipBuild("Static builds of QtWebEngine aren't supported.") return(false) } - !isPythonVersionSupported(): return(false) !isArchSupported(): return(false) isSanitizerEnabled():!isSanitizerSupported():!forceSanitizerBuild(): return(false) return(true) @@ -101,25 +100,6 @@ defineTest(isArchSupported) { return(false) } -defineTest(isPythonVersionSupported) { - python_error_msg = "Python version 2 (2.7.5 or later) is required to build Qt WebEngine." - python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') - python_version ~= s/[()]//g - python_version = $$split(python_version, ',') - python_major_version = $$first(python_version) - greaterThan(python_major_version, 2) { - skipBuild("Python version 3 is not supported by Chromium.") - skipBuild($$python_error_msg) - return(false) - } - python_minor_version = $$member(python_version, 1) - python_patch_version = $$member(python_version, 2) - greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) - skipBuild("Using Python version $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") - skipBuild($$python_error_msg) - return(false) -} - defineTest(isSanitizerEnabled) { sanitize_address|sanitize_memory|sanitize_undefined|sanitize_thread: return(true) return(false) @@ -358,6 +338,25 @@ defineTest(use?) { return(false) } +# Returns the unquoted path to the python executable. +defineReplace(pythonPath) { + isEmpty(QMAKE_PYTHON2) { + # Fallback for building QtWebEngine with Qt < 5.8 + QMAKE_PYTHON2 = python + } + return($$QMAKE_PYTHON2) +} + +# Returns the python executable for use with shell / make targets. +defineReplace(pythonPathForShell) { + return($$shell_quote($$shell_path($$pythonPath()))) +} + +# Returns the python executable for use with $$system() +defineReplace(pythonPathForSystem) { + return($$system_quote($$system_path($$pythonPath()))) +} + defineReplace(ninjaPath) { src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) -- cgit v1.2.3 From 18595c7fec423d165a80a8e5d300883a8160eec4 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 28 Apr 2017 08:33:54 +0200 Subject: Stabilize keyboardEvents auto tests The typeAheadTimeout is set to 1sec in Blink. Wait a bit more when selecting the next option in a HTML select element in auto tests. Change-Id: Ia3d9fde05b4d6cde9186aaa701ca48354ca74b4d Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_keyboardEvents.qml | 2 +- tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml index 677727632..2536f319b 100644 --- a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml +++ b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml @@ -143,7 +143,7 @@ TestWebEngineView { keyPress(Qt.Key_B); compareElementValue("combobox", "b"); // Must wait with the second key press to simulate selection of another element - wait(1000); + wait(1100); // blink::typeAheadTimeout + 0.1s keyPress(Qt.Key_C); compareElementValue("combobox", "c"); diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index ce88ace16..32a518ad8 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -1109,7 +1109,7 @@ void tst_QWebEngineView::keyboardEvents() QTest::keyPress(view.focusProxy(), Qt::Key_B); QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('combobox').value").toString(), QStringLiteral("b")); // Must wait with the second key press to simulate selection of another element - QTest::keyPress(view.focusProxy(), Qt::Key_C, Qt::NoModifier, 1000); + QTest::keyPress(view.focusProxy(), Qt::Key_C, Qt::NoModifier, 1100 /* blink::typeAheadTimeout + 0.1s */); QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('combobox').value").toString(), QStringLiteral("c")); // Test the Enter key by loading a page with a hyperlink -- cgit v1.2.3 From 4ee9cf19095a66b1cdb47229b1a1e7957dff584f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 27 Apr 2017 11:15:01 +0200 Subject: Fix macOS deployment target to match the one in Qt Core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The minimum required macOS deployment target in Qt 5.9 is 10.10. This should be passed on to Chromium, rather than hardcoding the value to 10.7, which was used in pre-Qt 5.6 days to actually require a higher version than Qt Core used at the time. Task-number: QTBUG-60438 Change-Id: Id2ae47f467f8cc92403c1cd7a467335ebbba4e8e Reviewed-by: Michael BrĂ¼ning --- src/3rdparty | 2 +- tools/qmake/mkspecs/features/default_pre.prf | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/3rdparty b/src/3rdparty index 853d4069e..898afbbf7 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 853d4069e45b06106f33611c458f5480f71e7c57 +Subproject commit 898afbbf79637101bbd5e6ab12695ced6a759ae7 diff --git a/tools/qmake/mkspecs/features/default_pre.prf b/tools/qmake/mkspecs/features/default_pre.prf index 77e437bc9..c7440fa7a 100644 --- a/tools/qmake/mkspecs/features/default_pre.prf +++ b/tools/qmake/mkspecs/features/default_pre.prf @@ -1,6 +1,3 @@ -# We depend on libc++ to build chromium so our macosx-version-min has to be 10.7 -QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 - QTWEBENGINEPROCESS_NAME_RELEASE = QtWebEngineProcess debug_and_release { QTWEBENGINEPROCESS_NAME_DEBUG = $$join(QTWEBENGINEPROCESS_NAME_RELEASE,,,d) -- cgit v1.2.3 From 9df14dff86fcc2daa0d9342174dba62ec32169bc Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 26 Apr 2017 15:39:33 +0200 Subject: Clean "system" calls to build&run gn and ninja There was a time when gn build was called during make step, however this was not working with recursive qmake calls. Clean up leftovers and fix path and warnings like "Conditional must expand to exactly one word." during builds. Change-Id: I8546520345a5f89ee829558fa0fd9183587848b3 Reviewed-by: Joerg Bornemann --- src/buildtools/gn.pro | 46 ++++++++++++++++++++-------------------------- src/buildtools/ninja.pro | 36 +++++++++++++++--------------------- src/core/gn_run.pro | 24 +++++++++++------------- 3 files changed, 46 insertions(+), 60 deletions(-) diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro index f8f8b20da..829e7a31a 100644 --- a/src/buildtools/gn.pro +++ b/src/buildtools/gn.pro @@ -1,36 +1,30 @@ TEMPLATE = aux -CONFIG += release - option(host_build) -defineReplace(buildGn) { - gn_args = $$1 - out = $$gnPath() - !qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()" - # check if it is not already build - !exists($$out) { - mkpath($$dirname(out)) - src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - gn_bootstrap = $$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py, $$src_3rd_party_dir)) - gn_args = $$system_quote($$gn_args) - gn_configure = $$system_quote($$gn_bootstrap) --shadow --gn-gen-args=$$gn_args $$ninja_path - !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$gn_configure") { - error("GN build error!") - } - } -} +!debug_and_release: CONFIG += release isQtMinimum(5, 8) { include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) QT_FOR_CONFIG += webengine-private } -!qtConfig(system-gn) { - buildgn.target = build_gn - buildgn.commands = $$buildGn($$gnArgs()) - QMAKE_EXTRA_TARGETS += buildgn - - default_target.target = first - default_target.depends = buildgn - QMAKE_EXTRA_TARGETS += default_target +build_pass|!debug_and_release { + !qtConfig(system-gn): CONFIG(release, debug|release) { + buildgn.target = build_gn + gn_args = $$gnArgs() + out = $$gnPath() + !qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()" + # check if it is not already build + !exists($$out) { + mkpath($$dirname(out)) + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + gn_bootstrap = $$system_path($$absolute_path(chromium/tools/gn/bootstrap/bootstrap.py, $$src_3rd_party_dir)) + gn_args = $$system_quote($$gn_args) + gn_configure = $$system_quote($$gn_bootstrap) --shadow --gn-gen-args=$$gn_args $$ninja_path + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$gn_configure") { + error("GN build error!") + } + } + QMAKE_DISTCLEAN += $$out + } } diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro index 0a01f1f4e..1b17c6dfa 100644 --- a/src/buildtools/ninja.pro +++ b/src/buildtools/ninja.pro @@ -1,31 +1,25 @@ TEMPLATE = aux -CONFIG += release -defineReplace(buildNinja) { - out = $$ninjaPath() - # check if it is not already build - !exists($$out) { - mkpath($$dirname(out)) - src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir))) - !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") { - error("NINJA build error!") - } - } -} +!debug_and_release: CONFIG += release isQtMinimum(5, 8) { include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) QT_FOR_CONFIG += webengine-private } -!qtConfig(system-ninja) { - buildninja.target = build_ninja - buildninja.commands = $$buildNinja() - QMAKE_EXTRA_TARGETS += buildninja - - default_target.target = first - default_target.depends = buildninja - QMAKE_EXTRA_TARGETS += default_target +build_pass|!debug_and_release { + !qtConfig(system-ninja): CONFIG(release, debug|release) { + out = $$ninjaPath() + # check if it is not already build + !exists($$out) { + mkpath($$dirname(out)) + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir))) + !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") { + error("NINJA build error!") + } + } + QMAKE_DISTCLEAN += $$out + } } diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index b6966a51d..ee4e7892e 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -5,13 +5,6 @@ isQtMinimum(5, 8) { TEMPLATE = aux -defineReplace(runGn) { - message("Running: $$1") - !system($$1) { - error("GN run error!") - } -} - qtConfig(debug_and_release): CONFIG += debug_and_release build_all qtConfig(system-ninja) { @@ -42,17 +35,22 @@ build_pass|!debug_and_release { gn_args += is_debug=false } - gn_args += "qtwebengine_target=\"$$shell_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\"" + gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\"" !qtConfig(system-gn) { - gn_binary = $$shell_quote($$shell_path($$gnPath())) + gn_binary = $$system_quote($$system_path($$gnPath())) } - gn_args = $$shell_quote($$gn_args) - gn_src_root = $$shell_quote($$shell_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) - gn_build_root = $$shell_quote($$shell_path($$OUT_PWD/$$getConfigDir())) + gn_args = $$system_quote($$gn_args) + gn_src_root = $$system_quote($$system_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir())) + gn_build_root = $$system_quote($$system_path($$OUT_PWD/$$getConfigDir())) gn_python = "--script-executable=$$pythonPathForSystem()" - $$runGn($$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root) + gn_run = $$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root + + message("Running: $$gn_run ") + !system($$gn_run) { + error("GN run error!") + } runninja.commands = $$NINJA \$\(NINJAFLAGS\) -C $$gn_build_root QtWebEngineCore QMAKE_EXTRA_TARGETS += runninja -- cgit v1.2.3 From b53896d1e7f3cad971edd56f303a32058cefde48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Wed, 26 Apr 2017 11:43:22 +0200 Subject: Detect the scenegraph software backend when it was set programatically Since 5.8, it is possible to set the Qt Quick scenegraph backend using QQuickWindow::setSceneGraph backend. However, this is not detectable by WebEngine's implementation as it relied on environment variables or command line options being specified. Task-number: QTBUG-60232 Change-Id: I53291510887ec5c75a15d5927a84e91fb5859e26 Reviewed-by: Kai Koehne --- src/core/web_engine_context.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 81f968d11..60622b4ae 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -91,6 +91,7 @@ #ifndef QT_NO_OPENGL # include #endif +#include #include #include #include @@ -157,6 +158,8 @@ bool usingQtQuick2DRenderer() } } + if (device.isEmpty()) + device = QQuickWindow::sceneGraphBackend(); if (device.isEmpty()) device = QString::fromLocal8Bit(qgetenv("QT_QUICK_BACKEND")); if (device.isEmpty()) -- cgit v1.2.3 From 8fb1dbef9c6606b49371f4c7baa8a21419146990 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 19 Apr 2017 11:12:10 +0200 Subject: Move qmake files to standard locations The tools/qmake directory is a left over from webkit where qmake was but one of many buildsystems. This is not necessary for qtwebengine, so we can instead use the standard locations. Change-Id: I3d126d6627295b113b091f3eabeee25f1c1f6183 Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- .qmake.conf | 2 - config.tests/alsa/alsa.pro | 2 + config.tests/alsa/alsatest.cpp | 37 ++ config.tests/khr/khr.cpp | 34 ++ config.tests/khr/khr.pro | 6 + config.tests/libvpx/libvpx.cpp | 35 ++ config.tests/libvpx/libvpx.pro | 3 + config.tests/snappy/snappy.cpp | 36 ++ config.tests/snappy/snappy.pro | 3 + config.tests/srtp/srtp.cpp | 35 ++ config.tests/srtp/srtp.pro | 3 + config.tests/winversion/winversion.cpp | 36 ++ config.tests/winversion/winversion.pro | 3 + configure.json | 2 - mkspecs/features/configure.prf | 213 +++++++++++ mkspecs/features/default_pre.prf | 20 + mkspecs/features/functions.prf | 408 +++++++++++++++++++++ mkspecs/features/gn_generator.prf | 244 ++++++++++++ qtwebengine.pro | 12 +- tools/qmake/config.tests/alsa/alsa.pro | 2 - tools/qmake/config.tests/alsa/alsatest.cpp | 37 -- tools/qmake/config.tests/khr/khr.cpp | 34 -- tools/qmake/config.tests/khr/khr.pro | 6 - tools/qmake/config.tests/libvpx/libvpx.cpp | 35 -- tools/qmake/config.tests/libvpx/libvpx.pro | 3 - tools/qmake/config.tests/snappy/snappy.cpp | 36 -- tools/qmake/config.tests/snappy/snappy.pro | 3 - tools/qmake/config.tests/srtp/srtp.cpp | 35 -- tools/qmake/config.tests/srtp/srtp.pro | 3 - tools/qmake/config.tests/winversion/winversion.cpp | 36 -- tools/qmake/config.tests/winversion/winversion.pro | 3 - tools/qmake/mkspecs/features/configure.prf | 213 ----------- tools/qmake/mkspecs/features/default_pre.prf | 20 - tools/qmake/mkspecs/features/functions.prf | 408 --------------------- tools/qmake/mkspecs/features/gn_generator.prf | 244 ------------ 35 files changed, 1124 insertions(+), 1128 deletions(-) create mode 100644 config.tests/alsa/alsa.pro create mode 100644 config.tests/alsa/alsatest.cpp create mode 100644 config.tests/khr/khr.cpp create mode 100644 config.tests/khr/khr.pro create mode 100644 config.tests/libvpx/libvpx.cpp create mode 100644 config.tests/libvpx/libvpx.pro create mode 100644 config.tests/snappy/snappy.cpp create mode 100644 config.tests/snappy/snappy.pro create mode 100644 config.tests/srtp/srtp.cpp create mode 100644 config.tests/srtp/srtp.pro create mode 100644 config.tests/winversion/winversion.cpp create mode 100644 config.tests/winversion/winversion.pro create mode 100644 mkspecs/features/configure.prf create mode 100644 mkspecs/features/default_pre.prf create mode 100644 mkspecs/features/functions.prf create mode 100644 mkspecs/features/gn_generator.prf delete mode 100644 tools/qmake/config.tests/alsa/alsa.pro delete mode 100644 tools/qmake/config.tests/alsa/alsatest.cpp delete mode 100644 tools/qmake/config.tests/khr/khr.cpp delete mode 100644 tools/qmake/config.tests/khr/khr.pro delete mode 100644 tools/qmake/config.tests/libvpx/libvpx.cpp delete mode 100644 tools/qmake/config.tests/libvpx/libvpx.pro delete mode 100644 tools/qmake/config.tests/snappy/snappy.cpp delete mode 100644 tools/qmake/config.tests/snappy/snappy.pro delete mode 100644 tools/qmake/config.tests/srtp/srtp.cpp delete mode 100644 tools/qmake/config.tests/srtp/srtp.pro delete mode 100644 tools/qmake/config.tests/winversion/winversion.cpp delete mode 100644 tools/qmake/config.tests/winversion/winversion.pro delete mode 100644 tools/qmake/mkspecs/features/configure.prf delete mode 100644 tools/qmake/mkspecs/features/default_pre.prf delete mode 100644 tools/qmake/mkspecs/features/functions.prf delete mode 100644 tools/qmake/mkspecs/features/gn_generator.prf diff --git a/.qmake.conf b/.qmake.conf index a988f0fac..71d8c7d74 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,5 +1,3 @@ -QMAKEPATH += $$PWD/tools/qmake - # Resolve root directories for sources QTWEBENGINE_ROOT = $$PWD QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD) diff --git a/config.tests/alsa/alsa.pro b/config.tests/alsa/alsa.pro new file mode 100644 index 000000000..7322b6fb8 --- /dev/null +++ b/config.tests/alsa/alsa.pro @@ -0,0 +1,2 @@ +SOURCES = alsatest.cpp + diff --git a/config.tests/alsa/alsatest.cpp b/config.tests/alsa/alsatest.cpp new file mode 100644 index 000000000..ea511cd21 --- /dev/null +++ b/config.tests/alsa/alsatest.cpp @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#if SND_LIB_VERSION < 0x1000a // 1.0.10 +#error "Alsa version found too old, require >= 1.0.10" +#endif + +int main(int argc,char **argv) +{ +} + diff --git a/config.tests/khr/khr.cpp b/config.tests/khr/khr.cpp new file mode 100644 index 000000000..df81bd6b2 --- /dev/null +++ b/config.tests/khr/khr.cpp @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/khr/khr.pro b/config.tests/khr/khr.pro new file mode 100644 index 000000000..b8e935f5a --- /dev/null +++ b/config.tests/khr/khr.pro @@ -0,0 +1,6 @@ +!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL +!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +CONFIG-=qt + +linux:SOURCES += khr.cpp diff --git a/config.tests/libvpx/libvpx.cpp b/config.tests/libvpx/libvpx.cpp new file mode 100644 index 000000000..258790309 --- /dev/null +++ b/config.tests/libvpx/libvpx.cpp @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/libvpx/libvpx.pro b/config.tests/libvpx/libvpx.pro new file mode 100644 index 000000000..aff6d1857 --- /dev/null +++ b/config.tests/libvpx/libvpx.pro @@ -0,0 +1,3 @@ +SOURCES += libvpx.cpp +PKGCONFIG += libvpx +CONFIG -= qt diff --git a/config.tests/snappy/snappy.cpp b/config.tests/snappy/snappy.cpp new file mode 100644 index 000000000..d52c73bd0 --- /dev/null +++ b/config.tests/snappy/snappy.cpp @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char **) +{ + snappy::Source* src = 0; + snappy::Sink* sink = 0; + return 0; +} diff --git a/config.tests/snappy/snappy.pro b/config.tests/snappy/snappy.pro new file mode 100644 index 000000000..890174a13 --- /dev/null +++ b/config.tests/snappy/snappy.pro @@ -0,0 +1,3 @@ +linux:SOURCES += snappy.cpp +LIBS += -lsnappy +CONFIG -= qt diff --git a/config.tests/srtp/srtp.cpp b/config.tests/srtp/srtp.cpp new file mode 100644 index 000000000..7dfcc832a --- /dev/null +++ b/config.tests/srtp/srtp.cpp @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int, char **) +{ + err_status_t status = srtp_init(); + return status == err_status_ok; +} diff --git a/config.tests/srtp/srtp.pro b/config.tests/srtp/srtp.pro new file mode 100644 index 000000000..2151d64aa --- /dev/null +++ b/config.tests/srtp/srtp.pro @@ -0,0 +1,3 @@ +linux:SOURCES += srtp.cpp +LIBS += -lsrtp +CONFIG -= qt diff --git a/config.tests/winversion/winversion.cpp b/config.tests/winversion/winversion.cpp new file mode 100644 index 000000000..3a7b67212 --- /dev/null +++ b/config.tests/winversion/winversion.cpp @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#if !defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190024213 +#error VS 2015 Update 3 with Cumulative Servicing Release or higher is required +#endif + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/winversion/winversion.pro b/config.tests/winversion/winversion.pro new file mode 100644 index 000000000..dc501a2f6 --- /dev/null +++ b/config.tests/winversion/winversion.pro @@ -0,0 +1,3 @@ +CONFIG-=qt +CONFIG+=console +win32: SOURCES += winversion.cpp diff --git a/configure.json b/configure.json index 605807a36..0c9a1de64 100644 --- a/configure.json +++ b/configure.json @@ -4,8 +4,6 @@ "printsupport" ], - "testDir": "tools/qmake/config.tests", - "commandline": { "options": { "alsa": "boolean", diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf new file mode 100644 index 000000000..f60be817c --- /dev/null +++ b/mkspecs/features/configure.prf @@ -0,0 +1,213 @@ +# Load configure.prf from qtbase first +load(configure) +load(functions) + +defineTest(runConfigure) { + webengine_successfully_configured: return(true) + linux:contains(QT_CONFIG,no-pkg-config) { + skipBuild("pkg-config is required") + return(false) + } + # Ignore the cached config tests results in case they were not successful + CONFIG += recheck + #Override the config.tests path + QMAKE_CONFIG_TESTS_DIR = $$QTWEBENGINE_ROOT/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(optimize_size): WEBENGINE_CONFIG += reduce_binary_size + qtConfig(system-webp): WEBENGINE_CONFIG += use_system_libwebp + else: WEBENGINE_CONFIG += use_bundled_libwebp + qtConfig(system-opus): WEBENGINE_CONFIG += use_system_opus + else: WEBENGINE_CONFIG += use_bundled_opus + qtConfig(system-ffmpeg): WEBENGINE_CONFIG += use_system_ffmpeg + else: WEBENGINE_CONFIG += use_bundled_ffmpeg + } else { + cross_compile: WEBENGINE_CONFIG += embedded_build reduce_binary_size + } + isQtMinimum(5, 9) { + qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code + } + + linux { + QT_FOR_CONFIG += gui-private + !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)") + + 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 + } + + 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_srtp: WEBENGINE_CONFIG += use_system_libsrtp + else { + log("System libsrtp not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_srtp + } + config_snappy: WEBENGINE_CONFIG += use_system_snappy + else { + log("System snappy not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_snappy + } + + !contains(WEBENGINE_CONFIG, embedded_build) { + packagesExist(nss): WEBENGINE_CONFIG += use_nss + else: log("System NSS not found, BoringSSL will be used.$${EOL}") + } + } + + win32 { + !config_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) { + cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG)) + export(WEBENGINE_CONFIG) + } + # Set a global WEBENGINE_ARCH for the target architecture we can also read from option(host_build) + WEBENGINE_ARCH = $$QT_ARCH + cache(WEBENGINE_ARCH) + export(WEBENGINE_ARCH) + } + + unix:!darwin { + log("System library dependencies:$${EOL}") + use?(system_icu) { + packagesExist("icu-uc icu-i18n") { + 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 + } + !isQtMinimum(5, 8) { + 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 + } + } + 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_,) + } + } + !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}") + use?(proprietary_codecs) { + log(" Proprietary codecs (H264, MP3) ..... Enabled$${EOL}") + } else { + log(" Proprietary codecs (H264, MP3) ..... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_proprietary_codecs)$${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?(appstore_compliant_code) { + log(" Mac App Store Compliant ............ Enabled$${EOL}") + } else { + log(" Mac App Store Compliant ............ Not enabled (Default, enable with WEBENGINE_CONFIG+=use_appstore_compliant_code)$${EOL}") + } + 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}") + } + } +} + diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf new file mode 100644 index 000000000..c7440fa7a --- /dev/null +++ b/mkspecs/features/default_pre.prf @@ -0,0 +1,20 @@ +QTWEBENGINEPROCESS_NAME_RELEASE = QtWebEngineProcess +debug_and_release { + QTWEBENGINEPROCESS_NAME_DEBUG = $$join(QTWEBENGINEPROCESS_NAME_RELEASE,,,d) +} else { + QTWEBENGINEPROCESS_NAME_DEBUG = $$QTWEBENGINEPROCESS_NAME_RELEASE +} +build_pass:CONFIG(debug, debug|release) { + QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_DEBUG +} else { + QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_RELEASE +} + +# Location of sync.profile +MODULE_BASE_DIR = $$QTWEBENGINE_ROOT + +EOL = $$escape_expand(\\n) + +# Call the original default_pre. +load(default_pre) +load(functions) diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf new file mode 100644 index 000000000..eb421f8b5 --- /dev/null +++ b/mkspecs/features/functions.prf @@ -0,0 +1,408 @@ +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(isMinMSVCVersion) { + actual = $$split(MSVC_VER, .) + actual_major = $$member(actual, 0) + actual_minor = $$member(actual, 1) + requested_major = $$1 + requested_minor = $$2 + lessThan(actual_major, $$requested_major): return(false) + greaterThan(actual_major, $$requested_major): return(true) + lessThan(actual_minor, $$requested_minor): return(false) + return(true) +} + +defineTest(isPlatformSupported) { + QT_FOR_CONFIG += gui-private + linux { + !gcc:!clang { + 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) + } + msvc { + !isMinMSVCVersion(14, 0) { + skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") + return(false) + } + } else { + skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") + return(false) + } + isBuildingOnWin32() { + skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.") + } + !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) + } + # 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")|contains(QT_ARCH, "mips64"): return(true) + + skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, MIPSel, and MIPS64 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") +} + +defineReplace(getChromiumSrcDir) { + exists($$QTWEBENGINE_ROOT/.git): git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir") + # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used) + isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium" + return($$git_chromium_src_dir) +} + +defineReplace(extractCFlag) { + CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS + OPTION = $$find(CFLAGS, $$1) + OPTION = $$split(OPTION, =) + return ($$member(OPTION, 1)) +} + +defineReplace(which) { + out = $$1 + win32 { + command = $$split(out, " ") + executable = $$first(command) + # Return the first match only + out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)") + isEmpty(out) { + message($$executable not found) + out = $$executable + } + for(arg, command): !equals(arg, $$executable): out += $$arg + } else:unix { + command = $$split(out, " ") + executable = $$first(command) + out = $$system("which $$executable 2>/dev/null") + isEmpty(out) { + message($$executable not found) + out = $$executable + } + for(arg, command): !equals(arg, $$executable): out += $$arg + } + 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) { + # Fallback for building QtWebEngine with Qt < 5.8 + QMAKE_PYTHON2 = python + } + return($$QMAKE_PYTHON2) +} + +# Returns the python executable for use with shell / make targets. +defineReplace(pythonPathForShell) { + return($$shell_quote($$shell_path($$pythonPath()))) +} + +# Returns the python executable for use with $$system() +defineReplace(pythonPathForSystem) { + return($$system_quote($$system_path($$pythonPath()))) +} + +defineReplace(ninjaPath) { + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) + win32: out = $${out}.exe + return($$out) +} + +defineReplace(gnPath) { + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + out = $$shadowed($$absolute_path(chromium/tools/gn/out/Release/gn, $$src_3rd_party_dir)) + + win32: out = $${out}.exe + return($$out) +} + +defineReplace(gnArgs) { + linux { + contains(WEBENGINE_CONFIG, 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) + win32: include($$QTWEBENGINE_ROOT/src/core/config/windows.pri) + isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.) + return($$gn_args) +} + +defineReplace(gnArch) { + qtArch = $$1 + contains(qtArch, "i386"): return(x86) + contains(qtArch, "x86_64"): return(x64) + contains(qtArch, "arm"): return(arm) + contains(qtArch, "arm64"): return(arm64) + contains(qtArch, "mips"): return(mipsel) + contains(qtArch, "mips64"): return(mips64el) + return(unknown) +} + +defineReplace(gnOS) { + macos: return(mac) + win32: return(win) + linux: return(linux) + error(Unsupported platform) + return(unknown) +} + +defineTest(skipBuild) { + skipBuildReason = "$$skipBuildReason $${EOL}$$1" + export(skipBuildReason) +} diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf new file mode 100644 index 000000000..91c045cfa --- /dev/null +++ b/mkspecs/features/gn_generator.prf @@ -0,0 +1,244 @@ +load(moc) +load(resources) + +defineReplace(getTargetType) { + equals(TEMPLATE, "app"):return("executable") + equals(TEMPLATE, "lib") { + CONFIG(static): return("static_library") + return("shared_library") + } + return("none") +} + +defineReplace(filter_flag_values) { + value_to_check = $$1 + macos:equals(value_to_check, "$(EXPORT_ARCH_ARGS)") { + # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way + # to figure out the architectures to pass to the compiler at Makefile time. Because this + # variable expansion is not supported by GN, we filter it out. GN takes care of assigning + # the architecture itself. + return("") + } + return($$value_to_check) +} + +isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn) +isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py" +isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py" + +# MOC SETUP + +GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," +GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," +for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\"," +GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ + ")" +GN_CONTENTS += "moc_source_cpp_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," +GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," +for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," +GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ + ")" + +DEFINES_LIST = $$join(DEFINES, " -D", "-D") +INCLUDE_LIST = $$join(INCLUDEPATH, " -I", "-I") + +# we don't generate a moc_predef file yet. +MOC_PREDEF_FILE = +MOC_COMMAND = $$clean_path($$mocCmdBase()) +MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(DEFINES)"), $$DEFINES_LIST) +MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(INCPATH)"), $$INCLUDE_LIST) +MOC_COMMAND = $$eval($$list($$MOC_COMMAND)) + +GN_CONTENTS += "if (moc_source_h_files != []) {" +GN_CONTENTS += " action_foreach(\"generate_h_mocs\") {"\ + " script = \"$$GN_RUN_BINARY_SCRIPT\"" +GN_CONTENTS += " sources = moc_source_h_files" \ + " outputs = [ \"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\" ]" +GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ + " args = [" +for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\"," +GN_CONTENTS += " \"{{source}}\"," \ + " \"-o\"," \ + " rebase_path(\"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\")"\ + " ]" +GN_CONTENTS += " }" +GN_CONTENTS += "}" +GN_CONTENTS += "if (moc_source_cpp_files != []) {" +GN_CONTENTS += " action_foreach(\"generate_cpp_mocs\") {"\ + " script = \"$$GN_RUN_BINARY_SCRIPT\"" +GN_CONTENTS += " sources = moc_source_cpp_files" \ + " outputs = [ \"$target_gen_dir/.moc/{{source_name_part}}.moc\" ]" +GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ + " args = [" +for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\"," +GN_CONTENTS += " \"{{source}}\"," \ + " \"-o\"," \ + " rebase_path(\"$target_gen_dir/.moc/{{source_name_part}}.moc\")"\ + " ]" +GN_CONTENTS += " }" +GN_CONTENTS += "}" + +# RESOURCES SETUP + +CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC) + +GN_CONTENTS += "action_foreach(\"generate_resources\") {"\ + " script = \"$$GN_RUN_BINARY_SCRIPT\"" +GN_CONTENTS += " sources = [" +for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," +GN_CONTENTS += " ]" \ + " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]" +GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ + " args = [" \ + " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\"," +for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\"" +GN_CONTENTS += " \"-name\"," \ + " \"{{source_name_part}}\"," \ + " \"{{source}}\"," \ + " \"-o\"," \ + " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\ + " ]" +GN_CONTENTS += "}" + +# TARGET SETUP + +TARGET_TYPE = $$getTargetType() + +GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {" +!isEmpty(GN_CREATE_PRI): GN_CONTENTS += " create_pri_file = $$GN_CREATE_PRI" +!isEmpty(GN_IMPORTS) { +for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")" +} + +!isEmpty(QMAKE_CFLAGS) { + GN_CONTENTS += " cflags = [" + for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," + GN_CONTENTS += " ]" +} + +!isEmpty(QMAKE_FRAMEWORKPATH) { + GN_CONTENTS += " cflags += [" + for(path, QMAKE_FRAMEWORKPATH): GN_CONTENTS += " \"-F$$path\"," + GN_CONTENTS += " ]" +} + +# Stop the barrage of unused variables warnings. +gcc|clang { + QMAKE_CXXFLAGS += "-Wno-unused-parameter" + QMAKE_CXXFLAGS += "-Wno-unused-variable" +} else:msvc { + QMAKE_CXXFLAGS += /wd4100 /wd4101 +} + +!isEmpty(QMAKE_CXXFLAGS) { + GN_CONTENTS += " cflags_cc = [" + for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," + GN_CONTENTS += " ]" +} + +GN_CONTENTS += " if (!defined(defines)) {"\ + " defines = []"\ + " }" +GN_CONTENTS += " defines += [" +# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking +# the macro. +# Also add a layer of escaping for double quotes. +for (define, DEFINES): { + define = $$replace(define,\",\\\") + define = $$replace(define,\',) + GN_CONTENTS += " \"$$define\"," +} +!isEmpty(QT_SYSROOT) { + !isEmpty(QMAKE_LIBDIR_EGL): + GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_EGL, $$[QT_SYSROOT])\\\"\"," + !isEmpty(QMAKE_LIBDIR_OPENGL_ES2) + GN_CONTENTS += " \"QT_LIBDIR_GLES2=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_OPENGL_ES2, $$[QT_SYSROOT])\\\"\"," +} else { + !isEmpty(QMAKE_LIBDIR_EGL): + GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$$QMAKE_LIBDIR_EGL\\\"\"," + !isEmpty(QMAKE_LIBDIR_OPENGL_ES2) + GN_CONTENTS += " \"QT_LIBDIR_GLES2=\\\"$$QMAKE_LIBDIR_OPENGL_ES2\\\"\"," +} +GN_CONTENTS += " ]" + +# Source files to compile +GN_CONTENTS += " sources = [" +for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," +for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\"," +GN_CONTENTS += " ]" + +# Add Sources generated by rcc from qrc files. +!isEmpty(RESOURCES): GN_CONTENTS += " sources += get_target_outputs(\":generate_resources\")" + +GN_CONTENTS += " if (!defined(include_dirs)) {"\ + " include_dirs = []"\ + " }" +GN_CONTENTS += " include_dirs += [" +for (path, INCLUDEPATH): GN_CONTENTS += " \"$$path\"," +GN_CONTENTS += " rebase_path(\"$target_gen_dir/.moc/\")" +GN_CONTENTS += " ]" + +GN_CONTENTS += " if (!defined(ldflags)) {"\ + " ldflags = []"\ + " }" +GN_CONTENTS += " ldflags += [" +for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," +for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\"," +!isEmpty(QMAKE_RPATHDIR) { + for (rpath, QMAKE_RPATHDIR) { + macos: GN_CONTENTS += " \"-Wl,-rpath,$${rpath}\"," + else:unix: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\"," + } +} +!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," +GN_CONTENTS += " ]" + +GN_CONTENTS += " if (!defined(lib_dirs)) {"\ + " lib_dirs = []"\ + " }" +GN_CONTENTS += " lib_dirs += [" +lib_dirs = $$find(LIBS, ^-L.*) +lib_dirs = $$unique(lib_dirs) +for (lib_dir, lib_dirs): GN_CONTENTS += " \"$$replace(lib_dir, -L, )\"," +GN_CONTENTS += " ]" + +GN_CONTENTS += " if (!defined(libs)) {"\ + " libs = []"\ + " }" +GN_CONTENTS += " libs += [" +for (lib, GN_LIBS): GN_CONTENTS += " \"$$lib\"," +libs = $$find(LIBS, ^-l.*) +libs = $$unique(libs) +for (lib, libs): GN_CONTENTS += " \"$$replace(lib, -l, )\"," +GN_CONTENTS += " ]" + +GN_CONTENTS += " if (!defined(deps)) {"\ + " deps = []"\ + " }" +GN_CONTENTS += " deps += [" +!isEmpty(RESOURCES): GN_CONTENTS += " \":generate_resources\"," +GN_CONTENTS += " ]" +GN_CONTENTS += " if (moc_source_h_files != []) {" +GN_CONTENTS += " deps += [" +GN_CONTENTS += " \":generate_h_mocs\"," +GN_CONTENTS += " ]" +# Add moc output files to compile +GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")" +GN_CONTENTS += " }" +GN_CONTENTS += " if (moc_source_cpp_files != []) {" +GN_CONTENTS += " deps += [" +GN_CONTENTS += " \":generate_cpp_mocs\"," +GN_CONTENTS += " ]" +GN_CONTENTS += " }" +GN_CONTENTS += "}" +!isEmpty(GN_INCLUDES) { + for (inc, GN_INCLUDES): GN_CONTENTS += $$cat($$inc,lines) +} + +build_pass|!debug_and_release: write_file($$GN_FILE, GN_CONTENTS) + +# The generated Makefile shouldn't build anything by itself, just re-run qmake if necessary +TEMPLATE = aux +SOURCES = +HEADERS = +RESOURCES = diff --git a/qtwebengine.pro b/qtwebengine.pro index b6e735876..c8f3555e3 100644 --- a/qtwebengine.pro +++ b/qtwebengine.pro @@ -16,9 +16,9 @@ isPlatformSupported() { OTHER_FILES = \ tools/buildscripts/* \ tools/scripts/* \ - tools/qmake/config.tests/khr/* \ - tools/qmake/config.tests/libcap/* \ - tools/qmake/config.tests/libvpx/* \ - tools/qmake/config.tests/snappy/* \ - tools/qmake/config.tests/srtp/* \ - tools/qmake/mkspecs/features/* + config.tests/khr/* \ + config.tests/libcap/* \ + config.tests/libvpx/* \ + config.tests/snappy/* \ + config.tests/srtp/* \ + mkspecs/features/* diff --git a/tools/qmake/config.tests/alsa/alsa.pro b/tools/qmake/config.tests/alsa/alsa.pro deleted file mode 100644 index 7322b6fb8..000000000 --- a/tools/qmake/config.tests/alsa/alsa.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = alsatest.cpp - diff --git a/tools/qmake/config.tests/alsa/alsatest.cpp b/tools/qmake/config.tests/alsa/alsatest.cpp deleted file mode 100644 index ea511cd21..000000000 --- a/tools/qmake/config.tests/alsa/alsatest.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#if SND_LIB_VERSION < 0x1000a // 1.0.10 -#error "Alsa version found too old, require >= 1.0.10" -#endif - -int main(int argc,char **argv) -{ -} - diff --git a/tools/qmake/config.tests/khr/khr.cpp b/tools/qmake/config.tests/khr/khr.cpp deleted file mode 100644 index df81bd6b2..000000000 --- a/tools/qmake/config.tests/khr/khr.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - return 0; -} diff --git a/tools/qmake/config.tests/khr/khr.pro b/tools/qmake/config.tests/khr/khr.pro deleted file mode 100644 index b8e935f5a..000000000 --- a/tools/qmake/config.tests/khr/khr.pro +++ /dev/null @@ -1,6 +0,0 @@ -!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL -!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL - -CONFIG-=qt - -linux:SOURCES += khr.cpp diff --git a/tools/qmake/config.tests/libvpx/libvpx.cpp b/tools/qmake/config.tests/libvpx/libvpx.cpp deleted file mode 100644 index 258790309..000000000 --- a/tools/qmake/config.tests/libvpx/libvpx.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -int main(int, char **) -{ - return 0; -} diff --git a/tools/qmake/config.tests/libvpx/libvpx.pro b/tools/qmake/config.tests/libvpx/libvpx.pro deleted file mode 100644 index aff6d1857..000000000 --- a/tools/qmake/config.tests/libvpx/libvpx.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += libvpx.cpp -PKGCONFIG += libvpx -CONFIG -= qt diff --git a/tools/qmake/config.tests/snappy/snappy.cpp b/tools/qmake/config.tests/snappy/snappy.cpp deleted file mode 100644 index d52c73bd0..000000000 --- a/tools/qmake/config.tests/snappy/snappy.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - snappy::Source* src = 0; - snappy::Sink* sink = 0; - return 0; -} diff --git a/tools/qmake/config.tests/snappy/snappy.pro b/tools/qmake/config.tests/snappy/snappy.pro deleted file mode 100644 index 890174a13..000000000 --- a/tools/qmake/config.tests/snappy/snappy.pro +++ /dev/null @@ -1,3 +0,0 @@ -linux:SOURCES += snappy.cpp -LIBS += -lsnappy -CONFIG -= qt diff --git a/tools/qmake/config.tests/srtp/srtp.cpp b/tools/qmake/config.tests/srtp/srtp.cpp deleted file mode 100644 index 7dfcc832a..000000000 --- a/tools/qmake/config.tests/srtp/srtp.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - err_status_t status = srtp_init(); - return status == err_status_ok; -} diff --git a/tools/qmake/config.tests/srtp/srtp.pro b/tools/qmake/config.tests/srtp/srtp.pro deleted file mode 100644 index 2151d64aa..000000000 --- a/tools/qmake/config.tests/srtp/srtp.pro +++ /dev/null @@ -1,3 +0,0 @@ -linux:SOURCES += srtp.cpp -LIBS += -lsrtp -CONFIG -= qt diff --git a/tools/qmake/config.tests/winversion/winversion.cpp b/tools/qmake/config.tests/winversion/winversion.cpp deleted file mode 100644 index 3a7b67212..000000000 --- a/tools/qmake/config.tests/winversion/winversion.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if !defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190024213 -#error VS 2015 Update 3 with Cumulative Servicing Release or higher is required -#endif - -int main(int, char **) -{ - return 0; -} diff --git a/tools/qmake/config.tests/winversion/winversion.pro b/tools/qmake/config.tests/winversion/winversion.pro deleted file mode 100644 index dc501a2f6..000000000 --- a/tools/qmake/config.tests/winversion/winversion.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG-=qt -CONFIG+=console -win32: SOURCES += winversion.cpp diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf deleted file mode 100644 index 55a7c45a4..000000000 --- a/tools/qmake/mkspecs/features/configure.prf +++ /dev/null @@ -1,213 +0,0 @@ -# Load configure.prf from qtbase first -load(configure) -load(functions) - -defineTest(runConfigure) { - webengine_successfully_configured: return(true) - linux:contains(QT_CONFIG,no-pkg-config) { - skipBuild("pkg-config is required") - return(false) - } - # Ignore the cached config tests results in case they were not successful - CONFIG += recheck - #Override the config.tests path - QMAKE_CONFIG_TESTS_DIR = $$QTWEBENGINE_ROOT/tools/qmake/config.tests - CONFIG_TESTS = $$files($$QMAKE_CONFIG_TESTS_DIR/*.pro, true) - log("Running configure tests$${EOL}") - for(test, CONFIG_TESTS) { - test = $$basename(test) - test ~= s/\\.pro$// - qtCompileTest($$test) - } - - 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(optimize_size): WEBENGINE_CONFIG += reduce_binary_size - qtConfig(system-webp): WEBENGINE_CONFIG += use_system_libwebp - else: WEBENGINE_CONFIG += use_bundled_libwebp - qtConfig(system-opus): WEBENGINE_CONFIG += use_system_opus - else: WEBENGINE_CONFIG += use_bundled_opus - qtConfig(system-ffmpeg): WEBENGINE_CONFIG += use_system_ffmpeg - else: WEBENGINE_CONFIG += use_bundled_ffmpeg - } else { - cross_compile: WEBENGINE_CONFIG += embedded_build reduce_binary_size - } - isQtMinimum(5, 9) { - qtConfig(appstore-compliant): WEBENGINE_CONFIG += use_appstore_compliant_code - } - - linux { - QT_FOR_CONFIG += gui-private - !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)") - - 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 - } - - 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_srtp: WEBENGINE_CONFIG += use_system_libsrtp - else { - log("System libsrtp not found. Using Chromium's copy.$${EOL}") - WEBENGINE_CONFIG += use_bundled_srtp - } - config_snappy: WEBENGINE_CONFIG += use_system_snappy - else { - log("System snappy not found. Using Chromium's copy.$${EOL}") - WEBENGINE_CONFIG += use_bundled_snappy - } - - !contains(WEBENGINE_CONFIG, embedded_build) { - packagesExist(nss): WEBENGINE_CONFIG += use_nss - else: log("System NSS not found, BoringSSL will be used.$${EOL}") - } - } - - win32 { - !config_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) { - cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG)) - export(WEBENGINE_CONFIG) - } - # Set a global WEBENGINE_ARCH for the target architecture we can also read from option(host_build) - WEBENGINE_ARCH = $$QT_ARCH - cache(WEBENGINE_ARCH) - export(WEBENGINE_ARCH) - } - - unix:!darwin { - log("System library dependencies:$${EOL}") - use?(system_icu) { - packagesExist("icu-uc icu-i18n") { - 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 - } - !isQtMinimum(5, 8) { - 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 - } - } - 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_,) - } - } - !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}") - use?(proprietary_codecs) { - log(" Proprietary codecs (H264, MP3) ..... Enabled$${EOL}") - } else { - log(" Proprietary codecs (H264, MP3) ..... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_proprietary_codecs)$${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?(appstore_compliant_code) { - log(" Mac App Store Compliant ............ Enabled$${EOL}") - } else { - log(" Mac App Store Compliant ............ Not enabled (Default, enable with WEBENGINE_CONFIG+=use_appstore_compliant_code)$${EOL}") - } - 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}") - } - } -} - diff --git a/tools/qmake/mkspecs/features/default_pre.prf b/tools/qmake/mkspecs/features/default_pre.prf deleted file mode 100644 index c7440fa7a..000000000 --- a/tools/qmake/mkspecs/features/default_pre.prf +++ /dev/null @@ -1,20 +0,0 @@ -QTWEBENGINEPROCESS_NAME_RELEASE = QtWebEngineProcess -debug_and_release { - QTWEBENGINEPROCESS_NAME_DEBUG = $$join(QTWEBENGINEPROCESS_NAME_RELEASE,,,d) -} else { - QTWEBENGINEPROCESS_NAME_DEBUG = $$QTWEBENGINEPROCESS_NAME_RELEASE -} -build_pass:CONFIG(debug, debug|release) { - QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_DEBUG -} else { - QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_RELEASE -} - -# Location of sync.profile -MODULE_BASE_DIR = $$QTWEBENGINE_ROOT - -EOL = $$escape_expand(\\n) - -# Call the original default_pre. -load(default_pre) -load(functions) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf deleted file mode 100644 index eb421f8b5..000000000 --- a/tools/qmake/mkspecs/features/functions.prf +++ /dev/null @@ -1,408 +0,0 @@ -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(isMinMSVCVersion) { - actual = $$split(MSVC_VER, .) - actual_major = $$member(actual, 0) - actual_minor = $$member(actual, 1) - requested_major = $$1 - requested_minor = $$2 - lessThan(actual_major, $$requested_major): return(false) - greaterThan(actual_major, $$requested_major): return(true) - lessThan(actual_minor, $$requested_minor): return(false) - return(true) -} - -defineTest(isPlatformSupported) { - QT_FOR_CONFIG += gui-private - linux { - !gcc:!clang { - 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) - } - msvc { - !isMinMSVCVersion(14, 0) { - skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") - return(false) - } - } else { - skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") - return(false) - } - isBuildingOnWin32() { - skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.") - } - !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) - } - # 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")|contains(QT_ARCH, "mips64"): return(true) - - skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, MIPSel, and MIPS64 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") -} - -defineReplace(getChromiumSrcDir) { - exists($$QTWEBENGINE_ROOT/.git): git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir") - # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used) - isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium" - return($$git_chromium_src_dir) -} - -defineReplace(extractCFlag) { - CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS - OPTION = $$find(CFLAGS, $$1) - OPTION = $$split(OPTION, =) - return ($$member(OPTION, 1)) -} - -defineReplace(which) { - out = $$1 - win32 { - command = $$split(out, " ") - executable = $$first(command) - # Return the first match only - out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)") - isEmpty(out) { - message($$executable not found) - out = $$executable - } - for(arg, command): !equals(arg, $$executable): out += $$arg - } else:unix { - command = $$split(out, " ") - executable = $$first(command) - out = $$system("which $$executable 2>/dev/null") - isEmpty(out) { - message($$executable not found) - out = $$executable - } - for(arg, command): !equals(arg, $$executable): out += $$arg - } - 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) { - # Fallback for building QtWebEngine with Qt < 5.8 - QMAKE_PYTHON2 = python - } - return($$QMAKE_PYTHON2) -} - -# Returns the python executable for use with shell / make targets. -defineReplace(pythonPathForShell) { - return($$shell_quote($$shell_path($$pythonPath()))) -} - -# Returns the python executable for use with $$system() -defineReplace(pythonPathForSystem) { - return($$system_quote($$system_path($$pythonPath()))) -} - -defineReplace(ninjaPath) { - src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) - win32: out = $${out}.exe - return($$out) -} - -defineReplace(gnPath) { - src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - out = $$shadowed($$absolute_path(chromium/tools/gn/out/Release/gn, $$src_3rd_party_dir)) - - win32: out = $${out}.exe - return($$out) -} - -defineReplace(gnArgs) { - linux { - contains(WEBENGINE_CONFIG, 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) - win32: include($$QTWEBENGINE_ROOT/src/core/config/windows.pri) - isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.) - return($$gn_args) -} - -defineReplace(gnArch) { - qtArch = $$1 - contains(qtArch, "i386"): return(x86) - contains(qtArch, "x86_64"): return(x64) - contains(qtArch, "arm"): return(arm) - contains(qtArch, "arm64"): return(arm64) - contains(qtArch, "mips"): return(mipsel) - contains(qtArch, "mips64"): return(mips64el) - return(unknown) -} - -defineReplace(gnOS) { - macos: return(mac) - win32: return(win) - linux: return(linux) - error(Unsupported platform) - return(unknown) -} - -defineTest(skipBuild) { - skipBuildReason = "$$skipBuildReason $${EOL}$$1" - export(skipBuildReason) -} diff --git a/tools/qmake/mkspecs/features/gn_generator.prf b/tools/qmake/mkspecs/features/gn_generator.prf deleted file mode 100644 index 91c045cfa..000000000 --- a/tools/qmake/mkspecs/features/gn_generator.prf +++ /dev/null @@ -1,244 +0,0 @@ -load(moc) -load(resources) - -defineReplace(getTargetType) { - equals(TEMPLATE, "app"):return("executable") - equals(TEMPLATE, "lib") { - CONFIG(static): return("static_library") - return("shared_library") - } - return("none") -} - -defineReplace(filter_flag_values) { - value_to_check = $$1 - macos:equals(value_to_check, "$(EXPORT_ARCH_ARGS)") { - # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way - # to figure out the architectures to pass to the compiler at Makefile time. Because this - # variable expansion is not supported by GN, we filter it out. GN takes care of assigning - # the architecture itself. - return("") - } - return($$value_to_check) -} - -isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn) -isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py" -isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py" - -# MOC SETUP - -GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," -GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," -for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\"," -GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ - ")" -GN_CONTENTS += "moc_source_cpp_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\"," -GN_CONTENTS += " [ \"$$_PRO_FILE_PWD_\"," -for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," -GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\ - ")" - -DEFINES_LIST = $$join(DEFINES, " -D", "-D") -INCLUDE_LIST = $$join(INCLUDEPATH, " -I", "-I") - -# we don't generate a moc_predef file yet. -MOC_PREDEF_FILE = -MOC_COMMAND = $$clean_path($$mocCmdBase()) -MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(DEFINES)"), $$DEFINES_LIST) -MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(INCPATH)"), $$INCLUDE_LIST) -MOC_COMMAND = $$eval($$list($$MOC_COMMAND)) - -GN_CONTENTS += "if (moc_source_h_files != []) {" -GN_CONTENTS += " action_foreach(\"generate_h_mocs\") {"\ - " script = \"$$GN_RUN_BINARY_SCRIPT\"" -GN_CONTENTS += " sources = moc_source_h_files" \ - " outputs = [ \"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\" ]" -GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ - " args = [" -for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\"," -GN_CONTENTS += " \"{{source}}\"," \ - " \"-o\"," \ - " rebase_path(\"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\")"\ - " ]" -GN_CONTENTS += " }" -GN_CONTENTS += "}" -GN_CONTENTS += "if (moc_source_cpp_files != []) {" -GN_CONTENTS += " action_foreach(\"generate_cpp_mocs\") {"\ - " script = \"$$GN_RUN_BINARY_SCRIPT\"" -GN_CONTENTS += " sources = moc_source_cpp_files" \ - " outputs = [ \"$target_gen_dir/.moc/{{source_name_part}}.moc\" ]" -GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ - " args = [" -for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\"," -GN_CONTENTS += " \"{{source}}\"," \ - " \"-o\"," \ - " rebase_path(\"$target_gen_dir/.moc/{{source_name_part}}.moc\")"\ - " ]" -GN_CONTENTS += " }" -GN_CONTENTS += "}" - -# RESOURCES SETUP - -CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC) - -GN_CONTENTS += "action_foreach(\"generate_resources\") {"\ - " script = \"$$GN_RUN_BINARY_SCRIPT\"" -GN_CONTENTS += " sources = [" -for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," -GN_CONTENTS += " ]" \ - " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]" -GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \ - " args = [" \ - " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\"," -for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\"" -GN_CONTENTS += " \"-name\"," \ - " \"{{source_name_part}}\"," \ - " \"{{source}}\"," \ - " \"-o\"," \ - " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\ - " ]" -GN_CONTENTS += "}" - -# TARGET SETUP - -TARGET_TYPE = $$getTargetType() - -GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {" -!isEmpty(GN_CREATE_PRI): GN_CONTENTS += " create_pri_file = $$GN_CREATE_PRI" -!isEmpty(GN_IMPORTS) { -for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")" -} - -!isEmpty(QMAKE_CFLAGS) { - GN_CONTENTS += " cflags = [" - for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," - GN_CONTENTS += " ]" -} - -!isEmpty(QMAKE_FRAMEWORKPATH) { - GN_CONTENTS += " cflags += [" - for(path, QMAKE_FRAMEWORKPATH): GN_CONTENTS += " \"-F$$path\"," - GN_CONTENTS += " ]" -} - -# Stop the barrage of unused variables warnings. -gcc|clang { - QMAKE_CXXFLAGS += "-Wno-unused-parameter" - QMAKE_CXXFLAGS += "-Wno-unused-variable" -} else:msvc { - QMAKE_CXXFLAGS += /wd4100 /wd4101 -} - -!isEmpty(QMAKE_CXXFLAGS) { - GN_CONTENTS += " cflags_cc = [" - for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," - GN_CONTENTS += " ]" -} - -GN_CONTENTS += " if (!defined(defines)) {"\ - " defines = []"\ - " }" -GN_CONTENTS += " defines += [" -# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking -# the macro. -# Also add a layer of escaping for double quotes. -for (define, DEFINES): { - define = $$replace(define,\",\\\") - define = $$replace(define,\',) - GN_CONTENTS += " \"$$define\"," -} -!isEmpty(QT_SYSROOT) { - !isEmpty(QMAKE_LIBDIR_EGL): - GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_EGL, $$[QT_SYSROOT])\\\"\"," - !isEmpty(QMAKE_LIBDIR_OPENGL_ES2) - GN_CONTENTS += " \"QT_LIBDIR_GLES2=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_OPENGL_ES2, $$[QT_SYSROOT])\\\"\"," -} else { - !isEmpty(QMAKE_LIBDIR_EGL): - GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$$QMAKE_LIBDIR_EGL\\\"\"," - !isEmpty(QMAKE_LIBDIR_OPENGL_ES2) - GN_CONTENTS += " \"QT_LIBDIR_GLES2=\\\"$$QMAKE_LIBDIR_OPENGL_ES2\\\"\"," -} -GN_CONTENTS += " ]" - -# Source files to compile -GN_CONTENTS += " sources = [" -for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\"," -for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\"," -GN_CONTENTS += " ]" - -# Add Sources generated by rcc from qrc files. -!isEmpty(RESOURCES): GN_CONTENTS += " sources += get_target_outputs(\":generate_resources\")" - -GN_CONTENTS += " if (!defined(include_dirs)) {"\ - " include_dirs = []"\ - " }" -GN_CONTENTS += " include_dirs += [" -for (path, INCLUDEPATH): GN_CONTENTS += " \"$$path\"," -GN_CONTENTS += " rebase_path(\"$target_gen_dir/.moc/\")" -GN_CONTENTS += " ]" - -GN_CONTENTS += " if (!defined(ldflags)) {"\ - " ldflags = []"\ - " }" -GN_CONTENTS += " ldflags += [" -for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\"," -for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\"," -!isEmpty(QMAKE_RPATHDIR) { - for (rpath, QMAKE_RPATHDIR) { - macos: GN_CONTENTS += " \"-Wl,-rpath,$${rpath}\"," - else:unix: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\"," - } -} -!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," -GN_CONTENTS += " ]" - -GN_CONTENTS += " if (!defined(lib_dirs)) {"\ - " lib_dirs = []"\ - " }" -GN_CONTENTS += " lib_dirs += [" -lib_dirs = $$find(LIBS, ^-L.*) -lib_dirs = $$unique(lib_dirs) -for (lib_dir, lib_dirs): GN_CONTENTS += " \"$$replace(lib_dir, -L, )\"," -GN_CONTENTS += " ]" - -GN_CONTENTS += " if (!defined(libs)) {"\ - " libs = []"\ - " }" -GN_CONTENTS += " libs += [" -for (lib, GN_LIBS): GN_CONTENTS += " \"$$lib\"," -libs = $$find(LIBS, ^-l.*) -libs = $$unique(libs) -for (lib, libs): GN_CONTENTS += " \"$$replace(lib, -l, )\"," -GN_CONTENTS += " ]" - -GN_CONTENTS += " if (!defined(deps)) {"\ - " deps = []"\ - " }" -GN_CONTENTS += " deps += [" -!isEmpty(RESOURCES): GN_CONTENTS += " \":generate_resources\"," -GN_CONTENTS += " ]" -GN_CONTENTS += " if (moc_source_h_files != []) {" -GN_CONTENTS += " deps += [" -GN_CONTENTS += " \":generate_h_mocs\"," -GN_CONTENTS += " ]" -# Add moc output files to compile -GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")" -GN_CONTENTS += " }" -GN_CONTENTS += " if (moc_source_cpp_files != []) {" -GN_CONTENTS += " deps += [" -GN_CONTENTS += " \":generate_cpp_mocs\"," -GN_CONTENTS += " ]" -GN_CONTENTS += " }" -GN_CONTENTS += "}" -!isEmpty(GN_INCLUDES) { - for (inc, GN_INCLUDES): GN_CONTENTS += $$cat($$inc,lines) -} - -build_pass|!debug_and_release: write_file($$GN_FILE, GN_CONTENTS) - -# The generated Makefile shouldn't build anything by itself, just re-run qmake if necessary -TEMPLATE = aux -SOURCES = -HEADERS = -RESOURCES = -- cgit v1.2.3 From 9265be9445ebd3bcd404dcca9186a1abc5c454cd Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 2 May 2017 16:10:55 +0200 Subject: QuickNanoBrowser: Code cleanup Fixes following warnings: error: Unknown component. (M300) warning: == and != may perform type coercion, use === or !== to avoid it. (M126) error: "autoLoadIconsForPage" is not a member of "WebEngineSettings". (M18) error: "touchIconsEnabled" is not a member of "WebEngineSettings". (M18) warning: "tab" is declared more than once. (M107) Also sort import list. Change-Id: I859ee341a7a84494975aea8ec5fb0d988a90d2b9 Reviewed-by: Allan Sandfeld Jensen --- examples/webengine/quicknanobrowser/BrowserWindow.qml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index c008425d9..b53db9bdb 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -48,15 +48,16 @@ ** ****************************************************************************/ +import Qt.labs.settings 1.0 +import QtQml 2.2 import QtQuick 2.2 -import QtWebEngine 1.2 import QtQuick.Controls 1.0 +import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Styles 1.0 +import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.0 import QtQuick.Window 2.1 -import QtQuick.Controls.Private 1.0 -import QtQuick.Dialogs 1.2 -import Qt.labs.settings 1.0 +import QtWebEngine 1.3 ApplicationWindow { id: browserWindow @@ -294,7 +295,7 @@ ApplicationWindow { id: httpDiskCacheEnabled text: "HTTP Disk Cache" checkable: !currentWebView.profile.offTheRecord - checked: (currentWebView.profile.httpCacheType == WebEngineProfile.DiskHttpCache) + checked: (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache) onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache } MenuItem { @@ -397,8 +398,8 @@ ApplicationWindow { tabs.currentIndex = tabs.count - 1 request.openIn(tab.item) } else if (request.destination == WebEngineView.NewViewInBackgroundTab) { - var tab = tabs.createEmptyTab(currentWebView.profile) - request.openIn(tab.item) + var backgroundTab = tabs.createEmptyTab(currentWebView.profile) + request.openIn(backgroundTab.item) } else if (request.destination == WebEngineView.NewViewInDialog) { var dialog = applicationRoot.createDialog(currentWebView.profile) request.openIn(dialog.currentWebView) -- cgit v1.2.3 From fa0aa60a9a7da656dad351e89e0a4612e889c7db Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 2 May 2017 16:25:23 +0200 Subject: QuickNanoBrowser: Unify use of semicolons in JS See also http://lists.qt-project.org/pipermail/development/2016-October/027441.html Change-Id: Id0f3e5e994e2160f7f199c02d5e79d0ad86a0d70 Reviewed-by: Allan Sandfeld Jensen --- .../webengine/quicknanobrowser/ApplicationRoot.qml | 18 +-- .../webengine/quicknanobrowser/BrowserWindow.qml | 126 ++++++++++----------- .../webengine/quicknanobrowser/DownloadView.qml | 12 +- .../quicknanobrowser/FullScreenNotification.qml | 12 +- 4 files changed, 84 insertions(+), 84 deletions(-) diff --git a/examples/webengine/quicknanobrowser/ApplicationRoot.qml b/examples/webengine/quicknanobrowser/ApplicationRoot.qml index 6735be932..78defab80 100644 --- a/examples/webengine/quicknanobrowser/ApplicationRoot.qml +++ b/examples/webengine/quicknanobrowser/ApplicationRoot.qml @@ -70,18 +70,18 @@ QtObject { onClosing: destroy() } function createWindow(profile) { - var newWindow = browserWindowComponent.createObject(root) - newWindow.currentWebView.profile = profile - profile.downloadRequested.connect(newWindow.onDownloadRequested) - return newWindow + var newWindow = browserWindowComponent.createObject(root); + newWindow.currentWebView.profile = profile; + profile.downloadRequested.connect(newWindow.onDownloadRequested); + return newWindow; } function createDialog(profile) { - var newDialog = browserDialogComponent.createObject(root) - newDialog.currentWebView.profile = profile - return newDialog + var newDialog = browserDialogComponent.createObject(root); + newDialog.currentWebView.profile = profile; + return newDialog; } function load(url) { - var browserWindow = createWindow(defaultProfile) - browserWindow.currentWebView.url = url + var browserWindow = createWindow(defaultProfile); + browserWindow.currentWebView.url = url; } } diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index b53db9bdb..596e4a76e 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -80,19 +80,19 @@ ApplicationWindow { Settings { id : appSettings - property alias autoLoadImages: loadImages.checked; - property alias javaScriptEnabled: javaScriptEnabled.checked; - property alias errorPageEnabled: errorPageEnabled.checked; - property alias pluginsEnabled: pluginsEnabled.checked; - property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked; - property alias autoLoadIconsForPage: autoLoadIconsForPage.checked; - property alias touchIconsEnabled: touchIconsEnabled.checked; + property alias autoLoadImages: loadImages.checked + property alias javaScriptEnabled: javaScriptEnabled.checked + property alias errorPageEnabled: errorPageEnabled.checked + property alias pluginsEnabled: pluginsEnabled.checked + property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked + property alias autoLoadIconsForPage: autoLoadIconsForPage.checked + property alias touchIconsEnabled: touchIconsEnabled.checked } Action { shortcut: "Ctrl+D" onTriggered: { - downloadView.visible = !downloadView.visible + downloadView.visible = !downloadView.visible; } } Action { @@ -107,14 +107,14 @@ ApplicationWindow { shortcut: StandardKey.Refresh onTriggered: { if (currentWebView) - currentWebView.reload() + currentWebView.reload(); } } Action { shortcut: StandardKey.AddTab onTriggered: { - tabs.createEmptyTab(currentWebView.profile) - tabs.currentIndex = tabs.count - 1 + tabs.createEmptyTab(currentWebView.profile); + tabs.currentIndex = tabs.count - 1; addressBar.forceActiveFocus(); addressBar.selectAll(); } @@ -129,23 +129,23 @@ ApplicationWindow { shortcut: "Escape" onTriggered: { if (currentWebView.state == "FullScreen") { - browserWindow.visibility = browserWindow.previousVisibility - fullScreenNotification.hide() + browserWindow.visibility = browserWindow.previousVisibility; + fullScreenNotification.hide(); currentWebView.triggerWebAction(WebEngineView.ExitFullScreen); } } } Action { shortcut: "Ctrl+0" - onTriggered: currentWebView.zoomFactor = 1.0; + onTriggered: currentWebView.zoomFactor = 1.0 } Action { shortcut: StandardKey.ZoomOut - onTriggered: currentWebView.zoomFactor -= 0.1; + onTriggered: currentWebView.zoomFactor -= 0.1 } Action { shortcut: StandardKey.ZoomIn - onTriggered: currentWebView.zoomFactor += 0.1; + onTriggered: currentWebView.zoomFactor += 0.1 } Action { @@ -188,7 +188,7 @@ ApplicationWindow { toolBar: ToolBar { id: navigationBar RowLayout { - anchors.fill: parent; + anchors.fill: parent ToolButton { enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward) menu:Menu { @@ -337,12 +337,12 @@ ApplicationWindow { TabView { id: tabs function createEmptyTab(profile) { - var tab = addTab("", tabComponent) + var tab = addTab("", tabComponent); // We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately. - tab.active = true - tab.title = Qt.binding(function() { return tab.item.title }) - tab.item.profile = profile - return tab + tab.active = true; + tab.title = Qt.binding(function() { return tab.item.title }); + tab.item.profile = profile; + return tab; } anchors.fill: parent @@ -356,10 +356,10 @@ ApplicationWindow { onLinkHovered: { if (hoveredUrl == "") - resetStatusText.start() + resetStatusText.start(); else { - resetStatusText.stop() - statusText.text = hoveredUrl + resetStatusText.stop(); + statusText.text = hoveredUrl; } } @@ -386,69 +386,69 @@ ApplicationWindow { settings.touchIconsEnabled: appSettings.touchIconsEnabled onCertificateError: { - error.defer() - sslDialog.enqueue(error) + error.defer(); + sslDialog.enqueue(error); } onNewViewRequested: { if (!request.userInitiated) - print("Warning: Blocked a popup window.") + print("Warning: Blocked a popup window."); else if (request.destination == WebEngineView.NewViewInTab) { - var tab = tabs.createEmptyTab(currentWebView.profile) - tabs.currentIndex = tabs.count - 1 - request.openIn(tab.item) + var tab = tabs.createEmptyTab(currentWebView.profile); + tabs.currentIndex = tabs.count - 1; + request.openIn(tab.item); } else if (request.destination == WebEngineView.NewViewInBackgroundTab) { - var backgroundTab = tabs.createEmptyTab(currentWebView.profile) - request.openIn(backgroundTab.item) + var backgroundTab = tabs.createEmptyTab(currentWebView.profile); + request.openIn(backgroundTab.item); } else if (request.destination == WebEngineView.NewViewInDialog) { - var dialog = applicationRoot.createDialog(currentWebView.profile) - request.openIn(dialog.currentWebView) + var dialog = applicationRoot.createDialog(currentWebView.profile); + request.openIn(dialog.currentWebView); } else { - var window = applicationRoot.createWindow(currentWebView.profile) - request.openIn(window.currentWebView) + var window = applicationRoot.createWindow(currentWebView.profile); + request.openIn(window.currentWebView); } } onFullScreenRequested: { if (request.toggleOn) { - webEngineView.state = "FullScreen" - browserWindow.previousVisibility = browserWindow.visibility - browserWindow.showFullScreen() - fullScreenNotification.show() + webEngineView.state = "FullScreen"; + browserWindow.previousVisibility = browserWindow.visibility; + browserWindow.showFullScreen(); + fullScreenNotification.show(); } else { - webEngineView.state = "" - browserWindow.visibility = browserWindow.previousVisibility - fullScreenNotification.hide() + webEngineView.state = ""; + browserWindow.visibility = browserWindow.previousVisibility; + fullScreenNotification.hide(); } - request.accept() + request.accept(); } onRenderProcessTerminated: { - var status = "" + var status = ""; switch (terminationStatus) { case WebEngineView.NormalTerminationStatus: - status = "(normal exit)" + status = "(normal exit)"; break; case WebEngineView.AbnormalTerminationStatus: - status = "(abnormal exit)" + status = "(abnormal exit)"; break; case WebEngineView.CrashedTerminationStatus: - status = "(crashed)" + status = "(crashed)"; break; case WebEngineView.KilledTerminationStatus: - status = "(killed)" + status = "(killed)"; break; } - print("Render process exited with code " + exitCode + " " + status) - reloadTimer.running = true + print("Render process exited with code " + exitCode + " " + status); + reloadTimer.running = true; } onWindowCloseRequested: { if (tabs.count == 1) - browserWindow.close() + browserWindow.close(); else - tabs.removeTab(tabs.currentIndex) + tabs.removeTab(tabs.currentIndex); } Timer { @@ -474,19 +474,19 @@ ApplicationWindow { "you may not be connected with the host you tried to connect to.\n" + "Do you wish to override the security check and continue?" onYes: { - certErrors.shift().ignoreCertificateError() - presentError() + certErrors.shift().ignoreCertificateError(); + presentError(); } onNo: reject() onRejected: reject() function reject(){ - certErrors.shift().rejectCertificate() - presentError() + certErrors.shift().rejectCertificate(); + presentError(); } function enqueue(error){ - certErrors.push(error) - presentError() + certErrors.push(error); + presentError(); } function presentError(){ visible = certErrors.length > 0 @@ -504,9 +504,9 @@ ApplicationWindow { } function onDownloadRequested(download) { - downloadView.visible = true - downloadView.append(download) - download.accept() + downloadView.visible = true; + downloadView.append(download); + download.accept(); } Rectangle { diff --git a/examples/webengine/quicknanobrowser/DownloadView.qml b/examples/webengine/quicknanobrowser/DownloadView.qml index 13be4bd78..ed28c761c 100644 --- a/examples/webengine/quicknanobrowser/DownloadView.qml +++ b/examples/webengine/quicknanobrowser/DownloadView.qml @@ -64,8 +64,8 @@ Rectangle { } function append(download) { - downloadModel.append(download) - downloadModel.downloads.push(download) + downloadModel.append(download); + downloadModel.downloads.push(download); } Component { @@ -113,14 +113,14 @@ Rectangle { anchors.right: parent.right iconSource: "icons/process-stop.png" onClicked: { - var download = downloadModel.downloads[index] + var download = downloadModel.downloads[index]; - download.cancel() + download.cancel(); downloadModel.downloads = downloadModel.downloads.filter(function (el) { return el.id !== download.id; }); - downloadModel.remove(index) + downloadModel.remove(index); } } } @@ -167,7 +167,7 @@ Rectangle { text: "OK" anchors.centerIn: parent onClicked: { - downloadView.visible = false + downloadView.visible = false; } } } diff --git a/examples/webengine/quicknanobrowser/FullScreenNotification.qml b/examples/webengine/quicknanobrowser/FullScreenNotification.qml index 80a63d479..f0487e868 100644 --- a/examples/webengine/quicknanobrowser/FullScreenNotification.qml +++ b/examples/webengine/quicknanobrowser/FullScreenNotification.qml @@ -51,14 +51,14 @@ Rectangle { opacity: 0 function show() { - visible = true - opacity = 1 - reset.start() + visible = true; + opacity = 1; + reset.start(); } function hide() { - reset.stop() - opacity = 0 + reset.stop(); + opacity = 0; } Behavior on opacity { @@ -66,7 +66,7 @@ Rectangle { duration: 750 onStopped: { if (opacity == 0) - visible = false + visible = false; } } } -- cgit v1.2.3 From f10db97d7a1d43a7c9119c697831cb964ed3ab92 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 3 Apr 2017 17:54:14 +0200 Subject: Improve Qt Creator indexing Includes gn sources, headers and defines Change-Id: I2abfb2c5238211a2305f6bdbcd082e832c048a2b Reviewed-by: Joerg Bornemann --- src/core/core.pro | 2 +- src/core/core_common.pri | 4 ---- src/core/core_module.pro | 3 --- src/core/core_project.pro | 17 ++++++++++++++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/core/core.pro b/src/core/core.pro index 91c5044b6..6cc8080e0 100644 --- a/src/core/core.pro +++ b/src/core/core.pro @@ -41,7 +41,7 @@ core_api.depends = gn_run # A fake project for qt creator core_project.file = core_project.pro -core_project.depends = core_headers +core_project.depends = gn_run SUBDIRS += \ core_headers \ diff --git a/src/core/core_common.pri b/src/core/core_common.pri index 9c29aea71..370fe4d2a 100644 --- a/src/core/core_common.pri +++ b/src/core/core_common.pri @@ -5,8 +5,4 @@ TARGET = QtWebEngineCore QT += qml quick webchannel QT_PRIVATE += quick-private gui-private core-private webenginecoreheaders-private -# Make QtCreator happy. -CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir() -INCLUDEPATH += $$CHROMIUM_SRC_DIR - qtHaveModule(positioning):QT += positioning diff --git a/src/core/core_module.pro b/src/core/core_module.pro index f4f3fb736..44e8ac613 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -130,9 +130,6 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat } OTHER_FILES = \ - $$files(../3rdparty/chromium/*.h, true) \ - $$files(../3rdparty/chromium/*.cc, true) \ - $$files(../3rdparty/chromium/*.mm, true) \ $$files(../3rdparty/chromium/*.py, true) \ $$files(../3rdparty/chromium/*.gyp, true) \ $$files(../3rdparty/chromium/*.gypi, true) \ diff --git a/src/core/core_project.pro b/src/core/core_project.pro index 8418ab22b..c046ce1ff 100644 --- a/src/core/core_project.pro +++ b/src/core/core_project.pro @@ -1,3 +1,18 @@ TEMPLATE = lib +# Fake project to make QtCreator happy. -include(core_chromium.pri) +include(core_common.pri) + +linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri + +!include($$linking_pri) { + error("Could not find the linking information that gn should have generated.") +} + +CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir() +INCLUDEPATH += $$CHROMIUM_SRC_DIR \ + $$OUT_PWD/$$getConfigDir()/gen + +SOURCES += $$NINJA_SOURCES +HEADERS += $$NINJA_HEADERS +DEFINES += $$NINJA_DEFINES -- cgit v1.2.3 From 2156011b0a6047cd2b49dd03f6f3145cfc0f64b0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 2 May 2017 15:46:56 +0200 Subject: markdown: Code beautification Change-Id: I74d30578a9725f10a8d4e86ff8740d5f467d0fbc Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/markdowneditor/document.h | 2 +- examples/webenginewidgets/markdowneditor/mainwindow.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/webenginewidgets/markdowneditor/document.h b/examples/webenginewidgets/markdowneditor/document.h index 3c16c251d..bc6552731 100644 --- a/examples/webenginewidgets/markdowneditor/document.h +++ b/examples/webenginewidgets/markdowneditor/document.h @@ -57,7 +57,7 @@ class Document : public QObject { Q_OBJECT - Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged) + Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL) public: explicit Document(QObject *parent = nullptr) : QObject(parent) {} diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.h b/examples/webenginewidgets/markdowneditor/mainwindow.h index ad0320373..817f626d8 100644 --- a/examples/webenginewidgets/markdowneditor/mainwindow.h +++ b/examples/webenginewidgets/markdowneditor/mainwindow.h @@ -67,7 +67,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); void openFile(const QString &path); -- cgit v1.2.3 From d1997972350c67b8e6dad46824424466aca79d37 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 26 Apr 2017 13:37:12 +0200 Subject: Fix typo in tst_newViewRequest.qml Change-Id: I3e22f09b0847cb7c5edc50ad12c73b62c4525072 Reviewed-by: Viktor Engelmann Reviewed-by: Valentin Fokin Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_newViewRequest.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml index 754a9e018..7a04d5f5b 100644 --- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml +++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml @@ -93,7 +93,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInTab); verify(!newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); compare(dialog.webEngineView.url, ""); newViewRequestedSpy.clear(); dialog.destroy(); @@ -109,7 +109,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInDialog); verify(!newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); newViewRequestedSpy.clear(); dialog.destroy(); @@ -128,7 +128,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInDialog); verify(newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); newViewRequestedSpy.clear(); dialog.destroy(); } -- cgit v1.2.3 From ce5d960aee8876fc3b879b98cf4699f3e131f4b7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 May 2017 10:32:23 +0200 Subject: Use qtbase optimize_size configure option The optimize-size configure option got landed generally in qtbase, so respond to that instead of doing our own. Change-Id: I8bfcf494a6f0d599bf375ae4ea73ce86ee02216b Reviewed-by: Oswald Buddenhagen Reviewed-by: Kai Koehne --- configure.json | 7 ------- mkspecs/features/configure.prf | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/configure.json b/configure.json index 0c9a1de64..805ed4001 100644 --- a/configure.json +++ b/configure.json @@ -8,7 +8,6 @@ "options": { "alsa": "boolean", "embedded": "boolean", - "optimize-for-size": { "type": "boolean", "name": "optimize_size" }, "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" } }, @@ -90,11 +89,6 @@ "purpose": "Enables the embedded build configuration", "output": [ "privateFeature" ] }, - "optimize_size": { - "label": "Optimize for size", - "autoDetect": "tests.embedded", - "output": [ "privateFeature" ] - }, "alsa": { "label": "ALSA", "condition": "config.unix && libs.alsa", @@ -180,7 +174,6 @@ "section": "Qt WebEngine", "entries": [ "embedded", - "optimize_size", "pepper-plugins", "printing-and-pdf", "proprietary-codecs", diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index f60be817c..9b0be0140 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -30,7 +30,6 @@ defineTest(runConfigure) { qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker qtConfig(webrtc): WEBENGINE_CONFIG += use_webrtc qtConfig(embedded): WEBENGINE_CONFIG += embedded_build - qtConfig(optimize_size): WEBENGINE_CONFIG += reduce_binary_size qtConfig(system-webp): WEBENGINE_CONFIG += use_system_libwebp else: WEBENGINE_CONFIG += use_bundled_libwebp qtConfig(system-opus): WEBENGINE_CONFIG += use_system_opus @@ -42,6 +41,9 @@ defineTest(runConfigure) { } 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 } linux { -- cgit v1.2.3 From 8ed45ab8997757ddd98ea8132f0a9bb3ad26e52a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 4 May 2017 12:03:47 +0200 Subject: SimpleBrowser: Press Ctrl-L to focus the location bar This commonly used short cut is a must-have for every browser, even simple ones. Change-Id: I2a0bde05bceeb5a4334e3a7168bd45a9335311ee Reviewed-by: Kai Koehne --- examples/webenginewidgets/simplebrowser/browserwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.cpp b/examples/webenginewidgets/simplebrowser/browserwindow.cpp index c01f912d3..762d56c85 100644 --- a/examples/webenginewidgets/simplebrowser/browserwindow.cpp +++ b/examples/webenginewidgets/simplebrowser/browserwindow.cpp @@ -105,6 +105,13 @@ BrowserWindow::BrowserWindow(QWidget *parent, Qt::WindowFlags flags) m_urlLineEdit->setFavIcon(QIcon(QStringLiteral(":defaulticon.png"))); + QAction *focusUrlLineEditAction = new QAction(this); + addAction(focusUrlLineEditAction); + focusUrlLineEditAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_L)); + connect(focusUrlLineEditAction, &QAction::triggered, this, [this] () { + m_urlLineEdit->setFocus(Qt::ShortcutFocusReason); + }); + handleWebViewTitleChanged(tr("Qt Simple Browser")); m_tabWidget->createTab(); } -- cgit v1.2.3 From b24a6419869c14e32e87cb97e529cc25c246b5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Wed, 5 Apr 2017 17:14:16 +0200 Subject: Create example for full screen feature in WebEngine Adds an example ('videoplayer') showing how to enable the Fullscreen API[1] in QWebEngineView. This is one of the missing examples blocking the removal of demobrowser. [1]: https://fullscreen.spec.whatwg.org Task-number: QTBUG-59820 Change-Id: Ib02a1556515d87e595ca54c2bce18c9144030fbc Reviewed-by: Kai Koehne Reviewed-by: Leena Miettinen Reviewed-by: Michal Klocek --- .../webenginewidgets/videoplayer/data/index.html | 23 +++ .../videoplayer/data/videoplayer.qrc | 5 + .../videoplayer/doc/images/videoplayer-example.png | Bin 0 -> 34140 bytes .../videoplayer/doc/src/videoplayer.qdoc | 186 +++++++++++++++++++++ .../videoplayer/fullscreennotification.cpp | 87 ++++++++++ .../videoplayer/fullscreennotification.h | 61 +++++++ .../videoplayer/fullscreenwindow.cpp | 88 ++++++++++ .../videoplayer/fullscreenwindow.h | 68 ++++++++ examples/webenginewidgets/videoplayer/main.cpp | 53 ++++++ .../webenginewidgets/videoplayer/mainwindow.cpp | 72 ++++++++ examples/webenginewidgets/videoplayer/mainwindow.h | 64 +++++++ .../webenginewidgets/videoplayer/videoplayer.pro | 19 +++ examples/webenginewidgets/webenginewidgets.pro | 3 +- src/webengine/doc/qtwebengine.qdocconf | 2 +- 14 files changed, 729 insertions(+), 2 deletions(-) create mode 100644 examples/webenginewidgets/videoplayer/data/index.html create mode 100644 examples/webenginewidgets/videoplayer/data/videoplayer.qrc create mode 100644 examples/webenginewidgets/videoplayer/doc/images/videoplayer-example.png create mode 100644 examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc create mode 100644 examples/webenginewidgets/videoplayer/fullscreennotification.cpp create mode 100644 examples/webenginewidgets/videoplayer/fullscreennotification.h create mode 100644 examples/webenginewidgets/videoplayer/fullscreenwindow.cpp create mode 100644 examples/webenginewidgets/videoplayer/fullscreenwindow.h create mode 100644 examples/webenginewidgets/videoplayer/main.cpp create mode 100644 examples/webenginewidgets/videoplayer/mainwindow.cpp create mode 100644 examples/webenginewidgets/videoplayer/mainwindow.h create mode 100644 examples/webenginewidgets/videoplayer/videoplayer.pro diff --git a/examples/webenginewidgets/videoplayer/data/index.html b/examples/webenginewidgets/videoplayer/data/index.html new file mode 100644 index 000000000..4a1bdc33e --- /dev/null +++ b/examples/webenginewidgets/videoplayer/data/index.html @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/examples/webenginewidgets/videoplayer/data/videoplayer.qrc b/examples/webenginewidgets/videoplayer/data/videoplayer.qrc new file mode 100644 index 000000000..c3322b454 --- /dev/null +++ b/examples/webenginewidgets/videoplayer/data/videoplayer.qrc @@ -0,0 +1,5 @@ + + + index.html + + diff --git a/examples/webenginewidgets/videoplayer/doc/images/videoplayer-example.png b/examples/webenginewidgets/videoplayer/doc/images/videoplayer-example.png new file mode 100644 index 000000000..9cf51d84a Binary files /dev/null and b/examples/webenginewidgets/videoplayer/doc/images/videoplayer-example.png differ diff --git a/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc new file mode 100644 index 000000000..599e13e6c --- /dev/null +++ b/examples/webenginewidgets/videoplayer/doc/src/videoplayer.qdoc @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webenginewidgets/videoplayer + \title WebEngine Widgets Video Player Example + \ingroup webengine-widgetexamples + \brief Displays full screen video using \l QWebEngineView + + \image videoplayer-example.png + + \e {Video Player} demonstrates how to support full screen playback of HTML5 + video using \l QWebEngineView. + + \l {https://fullscreen.spec.whatwg.org/}{The Fullscreen API} is a + cross-browser Javascript API that enables a web page to request that one of + its HTML elements be made to occupy the user's entire screen. It is + commonly used for full screen video playback via the \c