Skip to content

Commit 08dfdf0

Browse files
committed
stubs: configure flags based on SDK target
Due to the custom build system implemented in CMake for Swift, we cannot properly detect the target and set flags appropriately. Instead, assume that if the primary variant is an Apple target, that all targets are Apple variants. This fixes cross-compilation on macOS.
1 parent c3bf40c commit 08dfdf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/stubs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_swift_target_library(swiftStdlibStubs
4141
INSTALL_IN_COMPONENT
4242
stdlib)
4343

44-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
44+
if("${SWIFT_PRIMARY_VARIANT_SDK}" IN_LIST SWIFT_APPLE_PLATFORMS)
4545
set_property(SOURCE
4646
SwiftNativeNSXXXBaseARC.m
4747
APPEND_STRING PROPERTY COMPILE_FLAGS

0 commit comments

Comments
 (0)