summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/Functions.cmake35
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/api/qtwebenginecoreglobal.h1
-rw-r--r--src/core/content_browser_client_qt.cpp4
-rw-r--r--src/core/web_engine_context.cpp13
-rw-r--r--src/core/web_engine_library_info.cpp13
-rw-r--r--src/pdf/CMakeLists.txt2
-rw-r--r--tests/auto/pdfquick/multipageview/CMakeLists.txt4
8 files changed, 52 insertions, 26 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index bd892ee20..04f32d2c6 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -2,9 +2,11 @@
# SPDX-License-Identifier: BSD-3-Clause
function(assertTargets)
- qt_parse_all_arguments(arg "add_check_for_support"
- "" "" "MODULES;TARGETS" "${ARGN}"
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "" "MODULES;TARGETS"
)
+ _qt_internal_validate_all_args_are_parsed(arg)
+
foreach(module ${arg_MODULES})
if(NOT DEFINED ${module}_SUPPORT)
set(${module}_SUPPORT ON PARENT_SCOPE)
@@ -36,9 +38,11 @@ endfunction()
# TODO: this should be idealy in qtbase
function(add_check_for_support)
- qt_parse_all_arguments(arg "add_check_for_support"
- "" "" "MODULES;MESSAGE;CONDITION" "${ARGN}"
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "" "MODULES;MESSAGE;CONDITION"
)
+ _qt_internal_validate_all_args_are_parsed(arg)
+
foreach(module ${arg_MODULES})
if(NOT DEFINED ${module}_SUPPORT)
set(${module}_SUPPORT ON PARENT_SCOPE)
@@ -181,7 +185,9 @@ endmacro()
function(extend_gn_target target)
get_target_property(elements ${target} ELEMENTS)
- qt_parse_all_arguments(GN "extend_gn_target" "" "" "CONDITION;${elements}" "${ARGN}")
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "CONDITION;${elements}")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
if("x${GN_CONDITION}" STREQUAL x)
set(GN_CONDITION ON)
endif()
@@ -193,7 +199,9 @@ function(extend_gn_target target)
endfunction()
function(extend_gn_list outList)
- qt_parse_all_arguments(GN "extend_gn_list" "" "" "ARGS;CONDITION" "${ARGN}")
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARGS;CONDITION")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
if("x${GN_CONDITION}" STREQUAL x)
set(GN_CONDITION ON)
endif()
@@ -741,7 +749,9 @@ function(extract_cflag result cflag)
endfunction()
function(extend_gn_list_cflag outList)
- qt_parse_all_arguments(GN "extend_gn_list_cflag" "" "" "ARG;CFLAG" "${ARGN}")
+ cmake_parse_arguments(PARSE_ARGV 1 GN "" "" "ARG;CFLAG")
+ _qt_internal_validate_all_args_are_parsed(GN)
+
extract_cflag(cflag "${GN_CFLAG}")
if(cflag)
set(${outList} "${${outList}}" "${GN_ARG}=\"${cflag}\"" PARENT_SCOPE)
@@ -1040,9 +1050,11 @@ macro(append_pkg_config_setup)
endmacro()
function(add_ninja_command)
- qt_parse_all_arguments(arg "add_ninja_command"
- "" "TARGET;OUTPUT;BUILDDIR;MODULE" "BYPRODUCTS" "${ARGN}"
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "TARGET;OUTPUT;BUILDDIR;MODULE" "BYPRODUCTS"
)
+ _qt_internal_validate_all_args_are_parsed(arg)
+
string(REPLACE " " ";" NINJAFLAGS "$ENV{NINJAFLAGS}")
list(TRANSFORM arg_BYPRODUCTS PREPEND "${arg_BUILDDIR}/")
add_custom_command(
@@ -1141,9 +1153,10 @@ function(get_config_filenames c_config cxx_config static_config target_config)
endfunction()
function(add_gn_command)
- qt_parse_all_arguments(arg "add_gn_command"
- "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS" "${ARGN}"
+ cmake_parse_arguments(PARSE_ARGV 0 arg
+ "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS"
)
+ _qt_internal_validate_all_args_are_parsed(arg)
get_config_filenames(cConfigFileName cxxConfigFileName staticConfigFileName targetConfigFileName)
set(gnArgArgFile ${arg_BUILDDIR}/args.gn)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index fa8a7d18a..3b5d94148 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -69,8 +69,8 @@ foreach(arch ${archs})
DEFINES
QT_NO_KEYWORDS
QT_USE_QSTRINGBUILDER
- QTWEBENGINECORE_VERSION_STR=\\\\\\\\\"${QT_REPO_MODULE_VERSION}\\\\\\\\\"
- QTWEBENGINEPROCESS_NAME=\\\\\\\\\"${qtWebEngineProcessName}\\\\\\\\\"
+ QTWEBENGINECORE_VERSION_STR=${QT_REPO_MODULE_VERSION}
+ QTWEBENGINEPROCESS_NAME=${qtWebEngineProcessName}
BUILDING_CHROMIUM
"${forwardDeclarationMacro}"
CXX_COMPILE_OPTIONS
@@ -503,7 +503,7 @@ foreach(arch ${archs})
CMAKE_TARGET WebEngineCore
NINJA_TARGETS QtWebEngineCore convert_dict
GN_TARGET ${buildGn}
- GN_ARGS "${gnArgArg}"
+ GN_ARGS ${gnArgArg}
BUILDDIR ${buildDir}/${config}/${arch}
MODULE core
)
diff --git a/src/core/api/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index 305040808..3583e0848 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -18,6 +18,7 @@ QT_BEGIN_NAMESPACE
#define ASSERT_ENUMS_MATCH(A, B) Q_STATIC_ASSERT_X(static_cast<int>(A) == static_cast<int>(B), "The enum values must match");
Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineVersion() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineProcessName() noexcept;
Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumVersion() noexcept;
Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumSecurityPatchVersion() noexcept;
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 77e234864..bf39ebe2f 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -960,7 +960,9 @@ void ContentBrowserClientQt::OverrideURLLoaderFactoryParams(content::BrowserCont
std::string ContentBrowserClientQt::getUserAgent()
{
// Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
- return content::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION);
+ return content::BuildUserAgentFromProduct("QtWebEngine/" + std::string(qWebEngineVersion())
+ + " Chrome/"
+ + std::string(qWebEngineChromiumVersion()));
}
blink::UserAgentMetadata ContentBrowserClientQt::getUserAgentMetadata()
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 57be8b2f1..80cdc9165 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -117,6 +117,9 @@ Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
QT_END_NAMESPACE
#endif
+#define STRINGIFY_LITERAL(x) #x
+#define STRINGIFY_EXPANDED(x) STRINGIFY_LITERAL(x)
+
namespace QtWebEngineCore {
Q_LOGGING_CATEGORY(webEngineContextLog, "qt.webenginecontext")
@@ -897,13 +900,19 @@ bool WebEngineContext::closingDown()
QT_BEGIN_NAMESPACE
const char *qWebEngineVersion() noexcept
{
- return QTWEBENGINECORE_VERSION_STR;
+ return STRINGIFY_EXPANDED(QTWEBENGINECORE_VERSION_STR);
+}
+
+const char *qWebEngineProcessName() noexcept
+{
+ return STRINGIFY_EXPANDED(QTWEBENGINEPROCESS_NAME);
}
const char *qWebEngineChromiumVersion() noexcept
{
- return CHROMIUM_VERSION;
+ return STRINGIFY_EXPANDED(CHROMIUM_VERSION);
}
+
const char *qWebEngineChromiumSecurityPatchVersion() noexcept
{
return "108.0.5359.181"; // FIXME: Remember to update
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 588af5cc6..277317f6f 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -57,7 +57,7 @@ static QString getBundlePath(CFBundleRef frameworkBundle)
// The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
// We use it for the other OS X versions as well to make sure it works and because
// the directory structure should be the same.
- if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+ if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
path = QDir::cleanPath(qApp->applicationDirPath() % QLatin1String("/../../../.."));
} else if (frameworkBundle) {
CFURLRef bundleUrl = CFBundleCopyBundleURL(frameworkBundle);
@@ -75,7 +75,7 @@ static QString getResourcesPath(CFBundleRef frameworkBundle)
// The following is a fix for QtWebEngineProcess crashes on OS X 10.7 and before.
// We use it for the other OS X versions as well to make sure it works and because
// the directory structure should be the same.
- if (qApp->applicationName() == QLatin1String(QTWEBENGINEPROCESS_NAME)) {
+ if (qApp->applicationName() == QLatin1String(qWebEngineProcessName())) {
path = getBundlePath(frameworkBundle) % QLatin1String("/Resources");
} else if (frameworkBundle) {
CFURLRef resourcesRelativeUrl = CFBundleCopyResourcesDirectoryURL(frameworkBundle);
@@ -121,9 +121,9 @@ QString subProcessPath()
static QString processPath;
if (processPath.isEmpty()) {
#if defined(Q_OS_WIN)
- const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME) % QLatin1String(".exe");
+ const QString processBinary = QLatin1String(qWebEngineProcessName()) % QLatin1String(".exe");
#else
- const QString processBinary = QLatin1String(QTWEBENGINEPROCESS_NAME);
+ const QString processBinary = QLatin1String(qWebEngineProcessName());
#endif
QStringList candidatePaths;
@@ -133,8 +133,9 @@ QString subProcessPath()
candidatePaths << fromEnv;
} else {
#if defined(Q_OS_DARWIN) && defined(QT_MAC_FRAMEWORK_BUILD)
- candidatePaths << getBundlePath(frameworkBundle())
- % QStringLiteral("/Helpers/" QTWEBENGINEPROCESS_NAME ".app/Contents/MacOS/" QTWEBENGINEPROCESS_NAME);
+ candidatePaths << getBundlePath(frameworkBundle()) % QStringLiteral("/Helpers/")
+ % qWebEngineProcessName() % QStringLiteral(".app/Contents/MacOS/")
+ % qWebEngineProcessName();
#else
candidatePaths << QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)
% QLatin1Char('/') % processBinary;
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index de0d42a94..5f082e918 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -189,7 +189,7 @@ foreach(arch ${archs})
CMAKE_TARGET Pdf
NINJA_TARGETS QtPdf
GN_TARGET ${buildGn}
- GN_ARGS "${gnArgArg}"
+ GN_ARGS ${gnArgArg}
BUILDDIR ${buildDir}/${config}/${arch}
MODULE pdf
)
diff --git a/tests/auto/pdfquick/multipageview/CMakeLists.txt b/tests/auto/pdfquick/multipageview/CMakeLists.txt
index 283bebc79..50f7d7d8f 100644
--- a/tests/auto/pdfquick/multipageview/CMakeLists.txt
+++ b/tests/auto/pdfquick/multipageview/CMakeLists.txt
@@ -20,11 +20,11 @@ qt_internal_add_test(tst_multipageview
qt_internal_extend_target(tst_multipageview CONDITION ANDROID OR IOS
DEFINES
- QT_QMLTEST_DATADIR=\\\":/data\\\"
+ QT_QMLTEST_DATADIR=":/data"
)
qt_internal_extend_target(tst_multipageview CONDITION NOT ANDROID AND NOT IOS
DEFINES
- QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
+ QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
)