summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-01-25 08:44:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-08 08:07:35 +0000
commit451dbc93d065f50d471fc1e4652aa00184e3c071 (patch)
treeb4efd41b0d15be378540c9a4a4db6ece29b84ba9 /src
parentdd1b2bd1e4c5db9e962902368e4ac3b9debc8368 (diff)
Add QtPdf iOS builds
QtPDf iOS builds must support fat libs builds. Compared to 5.15 however this is done differently. Before we tweaked gn to compile multi arch with 'Xarch' parameter. This had few downsides as we could not determine which arch/cpu compiles given file as compilation was opaque to gn. The current approach is to follow mac universal builds, compile builds separately for each architecture and lipo the outcome. However, this introduces some issues as ios builds are static builds and creating lipo archive will gather object files, which should end up in final QtPdf lib instead. Therefore create multi arch object file instead of archive and use this one. Note the compiler now uses arch triple for Pdfium as Chromium does, however qt files still use 'arch' and '*-version-min' combination. Task-number: QTBUG-88614 Change-Id: I7775c8b4d1554df497eb61fa6187f12c00b9032d Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit 8998563677e3f308083ba1c4c28efd6fe3d850f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/pdf/CMakeLists.txt3
2 files changed, 8 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5ba4cb1c6..227e1186e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -117,6 +117,10 @@ endif()
# GN PROJECT
##
+if(CMAKE_CROSSCOMPILING AND NOT Gn_FOUND)
+ message(FATAL_ERROR "No gn found for cross-compilation")
+endif()
+
if(NOT Gn_FOUND)
externalproject_add(gn
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/gn
@@ -145,7 +149,7 @@ endif()
# HOST PROJECT
##
-if(CMAKE_CROSSCOMPILING)
+if(CMAKE_CROSSCOMPILING AND NOT IOS)
if(NOT Gn_FOUND)
message(FATAL_ERROR "\nHost gn not found - cross compilation not possible")
@@ -175,7 +179,7 @@ if(CMAKE_CROSSCOMPILING)
endif()
# install gn for cross build
-if(LINUX AND INSTALL_GN)
+if((LINUX OR MACOS) AND INSTALL_GN)
get_install_config(installConfig)
install(
PROGRAMS ${installDir}/bin/gn
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 675a2ad19..b572b3155 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -7,7 +7,6 @@ if(PkgConfig_FOUND)
endif()
set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
-add_subdirectory(plugins/imageformats/pdf)
##
# PDF MODULE
@@ -40,6 +39,8 @@ qt_internal_add_module(Pdf
Qt::Gui
)
+add_subdirectory(plugins/imageformats/pdf)
+
##
# PDF DOCS
##