Skip to content

Commit 2073907

Browse files
committed
Runtimes: introduce SwiftOnoneSupport
The main goal for now is to have this building for macOS, with little concern about matching the build flags used currently. Addresses rdar://143151393
1 parent 6b2fb2e commit 2073907

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,4 @@ add_subdirectory(runtime)
177177
add_subdirectory(stubs)
178178
add_subdirectory(CommandLineSupport)
179179
add_subdirectory(core)
180+
add_subdirectory(SwiftOnoneSupport)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SwiftOnoneSupport.swiftmodule"
36+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/SwiftOnoneSupport.swiftmodule"
37+
RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule")
38+
emit_swift_interface(swiftSwiftOnoneSupport)
39+
install_swift_interface(swiftSwiftOnoneSupport)
40+
41+
# Configure plist creation for Darwin platforms.
42+
generate_plist("${CMAKE_PROJECT_NAME}" "${CMAKE_PROJECT_VERSION}" swiftSwiftOnoneSupport)

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)