From 55a15a1c1b93d36d705fc69e44b5c806b807dd55 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 17:23:57 +0200 Subject: Add initial support for cross-building to iOS Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert --- tests/auto/CMakeLists.txt | 15 +++++++++++---- tests/manual/CMakeLists.txt | 7 +++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 0bd3b47d92..c03838bee1 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,8 +1,6 @@ # Generated from auto.pro. -if (NOT APPLE_UIKIT) - add_subdirectory(corelib) -endif() +add_subdirectory(corelib) if (QT_FEATURE_dbus) set(run_dbus_tests ON) if(NOT CMAKE_CROSSCOMPILING AND TARGET Qt::DBus) @@ -22,9 +20,18 @@ if (QT_FEATURE_dbus) add_subdirectory(dbus) endif() endif() -if (NOT APPLE_UIKIT AND TARGET Qt::Gui) +if (TARGET Qt::Gui) add_subdirectory(gui) endif() + +# special case begin +# Build only corelib and gui tests when targeting uikit (iOS), +# because the script can't handle the SUBDIRS assignment well. +if (APPLE_UIKIT) + return() +endif() +# special case end + if (TARGET Qt::Network AND NOT WINRT) add_subdirectory(network) endif() diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt index 31547f6df7..9d5a3effaa 100644 --- a/tests/manual/CMakeLists.txt +++ b/tests/manual/CMakeLists.txt @@ -1,5 +1,12 @@ # Generated from manual.pro. +# special case begn +# Don't build manual tests when targeting iOS. +if(APPLE_UIKIT) + return() +endif() +# special case end + add_subdirectory(bearerex) add_subdirectory(filetest) add_subdirectory(embeddedintoforeignwindow) -- cgit v1.2.3