summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-04-20 08:48:02 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-04-30 18:08:52 +0000
commitba74eaba11b2df9d6c2b23f7595e7bb1a03e911e (patch)
treee5dba781d76a41e4c8340e6813383aaa1d0f4dab /src/core
parent692e2295b5676652ff0d405fd9b916cbd428dad3 (diff)
Support cross-compilation on macOS
So far we only supported a cross-compiling with universal builds, however qmake also supports 'regular' cross compilation (by setting '-device-option'). This is semi-supported with qt-cmake as we need to provide additional configure defines like: * CMAKE_OSX_ARCHITECTURES=arm64 * CMAKE_SYSTEM_NAME=Darwin * CMAKE_OSX_DEPLOYMENT_TARGET=10.14 It might seem to be a far fetched issue, however in case of webengine doing the cross compilation for only one architecture allows to save compile times when testing only arm64 builds. Note we do not need to create gn toolchains for that case, however unlike universal builds it requires host qt build for tools. Pick-to: 6.3 6.2 Change-Id: Ica8470fdd4cad4866c1470e0403ffd019eaf39a6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/api/CMakeLists.txt3
-rw-r--r--src/core/tools/CMakeLists.txt2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index d0c64a848..15152af7f 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -461,7 +461,7 @@ endforeach()
# WEBENGINECORE SETUP
##
-set(arch ${CMAKE_SYSTEM_PROCESSOR})
+list(GET archs 0 arch)
target_include_directories(WebEngineCore PRIVATE
${buildDir}/$<CONFIG>/${arch}/gen
${buildDir}/$<CONFIG>/${arch}/gen/third_party/perfetto
@@ -503,7 +503,7 @@ endif()
# WEBENGINECORE DICT TOOL SETUP
##
-if(QT_FEATURE_webengine_spellchecker)
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
qt_get_tool_target_name(dict_target_name qwebengine_convert_dict)
target_include_directories(${dict_target_name} PRIVATE
../3rdparty/chromium
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index 803cd43c9..e46c95be3 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -95,7 +95,6 @@ add_dependencies(generate_docs_WebEngineCore generate_chromium_attributions)
# WEBENGINECORE RESOURCES
##
-set(arch ${CMAKE_SYSTEM_PROCESSOR})
#TODO: use simply filter / globbing-expressions
set(localeList am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr
gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk
@@ -107,6 +106,8 @@ set(resourceList qtwebengine_resources.pak
qtwebengine_devtools_resources.pak)
get_install_config(config)
+get_architectures(archs)
+list(GET archs 0 arch)
foreach(loc ${localeList})
get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak REALPATH)
diff --git a/src/core/tools/CMakeLists.txt b/src/core/tools/CMakeLists.txt
index 733c124e4..5f14c6ebd 100644
--- a/src/core/tools/CMakeLists.txt
+++ b/src/core/tools/CMakeLists.txt
@@ -3,7 +3,7 @@
# WEBENGINECORE DICT CONVERT TOOL
##
-if(QT_FEATURE_webengine_spellchecker)
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING)
qt_get_tool_target_name(dict_target_name qwebengine_convert_dict)
qt_internal_add_tool(${dict_target_name}
TARGET_DESCRIPTION "QtWebEngine Dictionary Conversion Tool"