summaryrefslogtreecommitdiffstats
path: root/src/host/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/CMakeLists.txt')
-rw-r--r--src/host/CMakeLists.txt38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 9053d1e59..d40275217 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.19)
if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
@@ -16,15 +19,18 @@ project(QtWebEngineConfigure
VERSION "${QT_REPO_MODULE_VERSION}"
LANGUAGES CXX C)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+find_package(Qt6 6.5 CONFIG REQUIRED COMPONENTS BuildInternals Core)
+qt_internal_project_setup()
+get_gn_arch(target_arch ${GN_TARGET_CPU})
+get_gn_arch(host_arch ${TEST_architecture_arch})
+get_v8_arch(v8_arch ${target_arch} ${host_arch})
set(buildDir ${CMAKE_CURRENT_BINARY_DIR})
-configure_gn_toolchain(host ${TEST_architecture_arch} ${TEST_architecture_arch}
+configure_gn_toolchain(host ${host_arch} ${host_arch}
${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
${buildDir}/host_toolchain
)
-get_v8_arch(GN_V8_HOST_CPU ${GN_TARGET_CPU} ${TEST_architecture_arch})
-configure_gn_toolchain(v8 ${GN_V8_HOST_CPU} ${GN_TARGET_CPU}
+configure_gn_toolchain(v8 ${v8_arch} ${target_arch}
${WEBENGINE_ROOT_SOURCE_DIR}/src/host/BUILD.toolchain.gn.in
${buildDir}/v8_toolchain)
@@ -36,3 +42,27 @@ if(QT_FEATURE_qtwebengine_build)
DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/core/v8_toolchain
)
endif()
+if(QT_FEATURE_qtpdf_build)
+ install(FILES ${buildDir}/host_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/pdf/host_toolchain
+ )
+ install(FILES ${buildDir}/v8_toolchain/BUILD.gn
+ DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/src/pdf/v8_toolchain
+ )
+endif()
+
+# TODO: this could be run as part of main configure with execute_process
+# Skip for qtpdf(android)
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU AND TEST_architecture_arch STREQUAL "x86_64"
+ AND GN_TARGET_CPU STREQUAL "arm" AND NOT MINGW AND NOT ANDROID)
+ try_compile(
+ has32HostCompiler
+ "${CMAKE_CURRENT_BINARY_DIR}/config.tests/hostcompiler"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/hostcompiler"
+ hostcompiler
+ )
+ if(NOT has32HostCompiler)
+ MESSAGE(FATAL_ERROR "Compiler does not support 32bit compilation")
+ endif()
+endif()