From 291817b0bf3f351843b0c1d0de237dc8df5c0fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 12 Feb 2024 18:26:16 +0100 Subject: [PATCH] cmake: Allow static library framework builds for macOS and iOS Frameworks on Apple systems have traditionally been wrappers around dynamic libraries (with headers and other resources bundled alongside the library), but nowadays it's fully supported to have frameworks with static libraries inside them. Enabling this allows us to build Qt for iOS statically, but as frameworks, which allows us to include privacy manifests for the Qt libraries in the frameworks. At build time Xcode will link the static library into the application, as normal, so nothing changes there. If the user then chooses to embed the Qt frameworks via the Xcode UI, the build system will not copy the static libraries inside the frameworks, but will copy the privacy manifest and other resources, which in turn allows Xcode to generate a privacy report for the application as a whole. Task-number: QTBUG-114319 Change-Id: Ibc8c70a97d288e27811eaedd242613fa206617e5 Reviewed-by: Alexandru Croitor --- configure.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index a7c7b57113b..e6fa9d3d371 100644 --- a/configure.cmake +++ b/configure.cmake @@ -563,7 +563,8 @@ qt_feature("headersclean" qt_feature_config("headersclean" QMAKE_PRIVATE_CONFIG) qt_feature("framework" PUBLIC LABEL "Build Apple Frameworks" - CONDITION APPLE AND BUILD_SHARED_LIBS + AUTODETECT BUILD_SHARED_LIBS + CONDITION APPLE ) qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") qt_feature_config("framework" QMAKE_PUBLIC_QT_CONFIG