Skip to content

Commit f8bba96

Browse files
authored
Merge pull request #78726 from edymtt/edymtt/add-ononesupport-to-runtimes
Runtimes: introduce `SwiftOnoneSupport`
2 parents 3745dd1 + 734c115 commit f8bba96

File tree

4 files changed

+54
-6
lines changed

4 files changed

+54
-6
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ option(SwiftCore_INSTALL_NESTED_SUBDIR "Install libraries under a platform and a
122122
set(SwiftCore_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftCore_INSTALL_NESTED_SUBDIR}>:/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}>")
123123
set(SwiftCore_INSTALL_SWIFTMODULEDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftCore_INSTALL_NESTED_SUBDIR}>:/${SwiftCore_PLATFORM_SUBDIR}>")
124124

125+
option(SwiftCore_ENABLE_ONONESUPPORT "Enable Onone Support" YES)
126+
125127
# TODO: Most of these should be attached to specific targets rather than applied
126128
# globally. They can be applied as part of the library interface if they
127129
# affect the behavior of libraries that build against a given target.
@@ -204,3 +206,6 @@ add_subdirectory(runtime)
204206
add_subdirectory(stubs)
205207
add_subdirectory(CommandLineSupport)
206208
add_subdirectory(core)
209+
if(SwiftCore_ENABLE_ONONESUPPORT)
210+
add_subdirectory(SwiftOnoneSupport)
211+
endif()
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
add_library(swiftSwiftOnoneSupport
2+
SwiftOnoneSupport.swift
3+
"${PROJECT_SOURCE_DIR}/linker-support/magic-symbols-for-install-name.c")
4+
5+
set_target_properties(swiftSwiftOnoneSupport PROPERTIES
6+
Swift_MODULE_NAME SwiftOnoneSupport)
7+
8+
if(APPLE AND BUILD_SHARED_LIBS)
9+
target_link_options(swiftSwiftOnoneSupport PRIVATE "SHELL:-Xlinker -headerpad_max_install_names")
10+
endif()
11+
12+
target_compile_options(swiftSwiftOnoneSupport PRIVATE
13+
$<$<COMPILE_LANGUAGE:Swift>:-parse-stdlib>
14+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-inline-generics=false>"
15+
16+
# We have to disable validation of TBD files, because this module is
17+
# _explicitly_ special-cased to result in extra symbols generated by the
18+
# optimizer, meaning TBDGen can't (and shouldn't: it has to run
19+
# pre-optimization for performance) list them.
20+
# See also caa3dd4d291ec93c1a59f1db62604e703bff8468
21+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -validate-tbd-against-ir=none>"
22+
23+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -check-onone-completeness>"
24+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-access-control>")
25+
26+
target_compile_definitions(swiftSwiftOnoneSupport PRIVATE
27+
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_TARGET_LIBRARY_NAME=swiftSwiftOnoneSupport>)
28+
29+
target_link_libraries(swiftSwiftOnoneSupport
30+
PRIVATE
31+
swiftShims
32+
swiftCore)
33+
34+
install(TARGETS swiftSwiftOnoneSupport
35+
ARCHIVE DESTINATION "${SwiftCore_INSTALL_LIBDIR}"
36+
LIBRARY DESTINATION "${SwiftCore_INSTALL_LIBDIR}"
37+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
38+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SwiftOnoneSupport.swiftmodule"
39+
DESTINATION "${SwiftCore_INSTALL_SWIFTMODULEDIR}/SwiftOnoneSupport.swiftmodule"
40+
RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule")
41+
emit_swift_interface(swiftSwiftOnoneSupport)
42+
install_swift_interface(swiftSwiftOnoneSupport)
43+
44+
# Configure plist creation for Darwin platforms.
45+
generate_plist("${CMAKE_PROJECT_NAME}" "${CMAKE_PROJECT_VERSION}" swiftSwiftOnoneSupport)

Runtimes/Core/cmake/caches/Vendors/Apple/apple-common.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ set(SwiftCore_ENABLE_RUNTIME_FUNCTION_COUNTERS ON CACHE BOOL "")
1313
set(SwiftCore_ENABLE_BACKDEPLOYMENT_SUPPORT ON CACHE BOOL "")
1414
set(SwiftCore_ENABLE_FILESYSTEM_SUPPORT ON CACHE BOOL "")
1515

16+
set(SwiftCore_ENABLE_ONONESUPPORT OFF CACHE BOOL "")
17+
1618
set(SwiftCore_INSTALL_NESTED_SUBDIR OFF CACHE BOOL "")
1719

1820
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -g -DNDEBUG" CACHE STRING "")

Runtimes/Resync.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ set(CoreLibs
7878
CompatibilityOverride
7979
stubs
8080
CommandLineSupport
81-
core)
81+
core
82+
SwiftOnoneSupport)
8283

8384
# Add these as we get them building
84-
# core
85-
# Concurrency
86-
# SwiftOnoneSUpport
87-
# CommandLineSupport
8885
# Demangling
89-
# runtime)
9086

9187
foreach(library ${CoreLibs})
9288
copy_library_sources(${library} "public" "Core")

0 commit comments

Comments
 (0)