diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-11-02 15:10:08 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-11-02 17:52:23 +0100 |
commit | 7b29c1fe6fea9ee1a13082ba72483db76ce35719 (patch) | |
tree | 172be0e2fb2610df88744ef727599182675dfb2d | |
parent | 92a442669a91aa3934f3cc24e8422a9651fc6d30 (diff) |
CMake: Fix multi-arch iOS builds due to absolute framework paths
find_library(FWWebKit WebKit) stores the absolute path to the
framework of one of the sysroots, into FWWebKit.
When building with CMake 3.27 targeting multi-arch iOS, this results
in the following flag being passed to the compiler, regardless of
the architecture/sysroot:
-F/Applications/Xcode14.app/Contents/Developer/Platforms/
iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/
System/Library/Frameworks
This causes warnings when building qdarwinwebview.mm regarding
unsupported webkit features during the x86_64 simulator build. When
combined with -Werror, it fails the build.
Use qt_internal_find_apple_system_framework() instead of
find_library(), to ensure we pass '-framework WebKit' instead of the
absolute path to the framework. This avoids warnings and is
cross-sysroot compatible.
As a drive-by, also fix the lookup of the Foundation framework. It's
called Foundation, not FoundationKit.
Pick-to: 6.2 6.5 6.6
Task-number: QTBUG-118138
Change-Id: I4379f14d65a37470f08ae8e7f46e00b886eadaf1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r-- | src/plugins/darwin/CMakeLists.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/darwin/CMakeLists.txt b/src/plugins/darwin/CMakeLists.txt index e9b1981..93cb468 100644 --- a/src/plugins/darwin/CMakeLists.txt +++ b/src/plugins/darwin/CMakeLists.txt @@ -5,10 +5,10 @@ ## QDarwinWebViewPlugin Plugin: ##################################################################### -find_library(FWWebKit WebKit) -find_library(FWAppKit AppKit) -find_library(FWUIKit UIKit) -find_library(FWFoundation FoundationKit) +qt_internal_find_apple_system_framework(FWWebKit WebKit) +qt_internal_find_apple_system_framework(FWAppKit AppKit) +qt_internal_find_apple_system_framework(FWUIKit UIKit) +qt_internal_find_apple_system_framework(FWFoundation Foundation) qt_internal_add_plugin(QDarwinWebViewPlugin OUTPUT_NAME qtwebview_darwin |