diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index 07afc1a896..a994fc5e55 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -229,7 +229,9 @@ function(qt_auto_detect_ios) endif() set(CMAKE_OSX_ARCHITECTURES "${osx_architectures}" CACHE STRING "") - qt_internal_ensure_static_qt_config() + if(NOT DEFINED BUILD_SHARED_LIBS) + qt_internal_ensure_static_qt_config() + endif() # Disable qt rpaths for iOS, just like mkspecs/common/uikit.conf does, due to those # bundles not being able to use paths outside the app bundle. Not sure this is strictly diff --git a/cmake/QtFrameworkHelpers.cmake b/cmake/QtFrameworkHelpers.cmake index e4e2a1373f..e97c30956e 100644 --- a/cmake/QtFrameworkHelpers.cmake +++ b/cmake/QtFrameworkHelpers.cmake @@ -57,7 +57,7 @@ function(qt_internal_find_apple_system_framework out_var framework_name) endif() endfunction() -# Copy header files to QtXYZ.framework/Versions/A/Headers/ +# Copy header files to the framework's Headers directory # Use this function for header files that # - are not added as source files to the target # - are not marked as PUBLIC_HEADER @@ -163,7 +163,12 @@ function(qt_internal_get_framework_info out_var target) set(${out_var}_name "${module}") set(${out_var}_dir "${${out_var}_name}.framework") set(${out_var}_header_dir "${${out_var}_dir}/Headers") - set(${out_var}_versioned_header_dir "${${out_var}_dir}/Versions/${${out_var}_version}/Headers") + if(UIKIT) + # iOS frameworks do not version their headers + set(${out_var}_versioned_header_dir "${${out_var}_header_dir}") + else() + set(${out_var}_versioned_header_dir "${${out_var}_dir}/Versions/${${out_var}_version}/Headers") + endif() set(${out_var}_private_header_dir "${${out_var}_header_dir}/${${out_var}_bundle_version}") set(${out_var}_private_module_header_dir "${${out_var}_private_header_dir}/${module}") diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index bc98e77c7d..819ea1b334 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -327,7 +327,10 @@ function(qt_internal_add_module target) EXPORT_PROPERTIES "${export_properties}") endif() - if(WASM AND BUILD_SHARED_LIBS) + # FIXME: This workaround is needed because the deployment logic + # for iOS and WASM just copies/embeds the directly linked library, + # which will just be a versioned symlink to the actual library. + if((UIKIT OR WASM) AND BUILD_SHARED_LIBS) set(version_args "") else() set(version_args diff --git a/configure.cmake b/configure.cmake index b15661bf28..32974bbe90 100644 --- a/configure.cmake +++ b/configure.cmake @@ -477,7 +477,6 @@ qt_feature("android-style-assets" PRIVATE ) qt_feature("shared" PUBLIC LABEL "Building shared libraries" - AUTODETECT NOT UIKIT CONDITION BUILD_SHARED_LIBS ) qt_feature_definition("shared" "QT_STATIC" NEGATE PREREQUISITE "!defined(QT_SHARED) && !defined(QT_STATIC)") diff --git a/src/plugins/platforms/ios/CMakeLists.txt b/src/plugins/platforms/ios/CMakeLists.txt index 7b654af2a4..a822005b94 100644 --- a/src/plugins/platforms/ios/CMakeLists.txt +++ b/src/plugins/platforms/ios/CMakeLists.txt @@ -9,6 +9,7 @@ qt_internal_add_plugin(QIOSIntegrationPlugin OUTPUT_NAME qios + STATIC # Force static, even in shared builds DEFAULT_IF ${QT_QPA_DEFAULT_PLATFORM} MATCHES ios # special case PLUGIN_TYPE platforms SOURCES @@ -36,6 +37,7 @@ qt_internal_add_plugin(QIOSIntegrationPlugin ${FWMetal} ${FWQuartzCore} ${FWUIKit} + ${FWCoreGraphics} Qt::CorePrivate Qt::GuiPrivate ) diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt index 093e74c3e9..ab1e5b6c4a 100644 --- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt @@ -9,6 +9,7 @@ qt_internal_add_plugin(QIosOptionalPlugin_NSPhotoLibraryPlugin OUTPUT_NAME qiosnsphotolibrarysupport + STATIC # Force static, even in shared builds PLUGIN_TYPE platforms/darwin CLASS_NAME QIosOptionalPlugin_NSPhotoLibrary DEFAULT_IF FALSE