Skip to content

Commit 2ae36df

Browse files
authored
Move SWIFT_STDLIB_ENABLE_OBJC_INTEROP back to the main CMakeLists.txt (#39816)
1 parent d2f3903 commit 2ae36df

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,18 @@ option(SWIFT_REPORT_STATISTICS
405405
"Create json files which contain internal compilation statistics"
406406
FALSE)
407407

408+
# Only Darwin platforms enable ObjC interop by default.
409+
if("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
410+
set(SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default TRUE)
411+
else()
412+
set(SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default FALSE)
413+
endif()
414+
415+
# Used by stdlib/toolchain as well, so this cannot be in stdlib/CMakeLists.txt
416+
option(SWIFT_STDLIB_ENABLE_OBJC_INTEROP
417+
"Should stdlib be built with Obj-C interop."
418+
"${SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default}")
419+
408420
#
409421
# User-configurable experimental options. Do not use in production builds.
410422
#

stdlib/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ else()
6868
set(SWIFT_STDLIB_HAS_ASL_default FALSE)
6969
endif()
7070

71-
# Only Darwin platforms enable ObjC interop by default.
72-
if("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
73-
set(SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default TRUE)
74-
else()
75-
set(SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default FALSE)
76-
endif()
77-
7871
#
7972
# User-configurable options for the standard library.
8073
#
@@ -86,10 +79,6 @@ option(SWIFT_STDLIB_STABLE_ABI
8679
"Should stdlib be built with stable ABI (library evolution, resilience)."
8780
"${SWIFT_STDLIB_STABLE_ABI_default}")
8881

89-
option(SWIFT_STDLIB_ENABLE_OBJC_INTEROP
90-
"Should stdlib be built with Obj-C interop."
91-
"${SWIFT_STDLIB_ENABLE_OBJC_INTEROP_default}")
92-
9382
option(SWIFT_ENABLE_MODULE_INTERFACES
9483
"Generate .swiftinterface files alongside .swiftmodule files"
9584
"${SWIFT_STDLIB_STABLE_ABI}")

0 commit comments

Comments
 (0)