Skip to content

Commit 5ef02f6

Browse files
committed
[CMake] Check target, not host, for Info.plist
The CMake variable `APPLE` is set to true when building on a macOS host, which means that logic to include linker flags for application extensions, etc., will be enabled on a macOS host. That is, they will be enabled even when cross-compiling the standard library to a non-Apple platform, such as Android. Instead of using `APPLE` to check the host OS, check whether the target is an Apple platform.
1 parent 27fc4b0 commit 5ef02f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ function(_add_swift_library_single target name)
972972

973973
# Configure plist creation for OS X.
974974
set(PLIST_INFO_PLIST "Info.plist" CACHE STRING "Plist name")
975-
if(APPLE AND SWIFTLIB_SINGLE_IS_STDLIB)
975+
if("${SWIFTLIB_SINGLE_SDK}" IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_SINGLE_IS_STDLIB)
976976
set(PLIST_INFO_NAME ${name})
977977
set(PLIST_INFO_UTI "com.apple.dt.runtime.${name}")
978978
set(PLIST_INFO_VERSION "${SWIFT_VERSION}")

0 commit comments

Comments
 (0)