Skip to content

Commit eaafb0e

Browse files
committed
Manually merge remote-tracking branch 'origin/main' into rebranch
Conflicts: - lib/ClangImporter/ClangImporter.cpp
2 parents 2997ac3 + 9d9c9f0 commit eaafb0e

File tree

271 files changed

+939
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+939
-371
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,17 @@ set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_WATCHOS "2.0")
630630
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_XROS "1.0")
631631
set(COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_MACCATALYST "13.1")
632632

633+
set(SWIFT_DARWIN_TEST_DEPLOYMENT_VERSION_OSX "${SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX}" CACHE STRING
634+
"Deployment target version for building macOS tests")
635+
set(SWIFT_DARWIN_TEST_DEPLOYMENT_VERSION_IOS "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}" CACHE STRING
636+
"Deployment target version for building iOS tests")
637+
set(SWIFT_DARWIN_TEST_DEPLOYMENT_VERSION_TVOS "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}" CACHE STRING
638+
"Deployment target version for building tvOS tests")
639+
set(SWIFT_DARWIN_TEST_DEPLOYMENT_VERSION_WATCHOS "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}" CACHE STRING
640+
"Deployment target version for building watchOS tests")
641+
set(SWIFT_DARWIN_TEST_DEPLOYMENT_VERSION_XROS "${SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS}" CACHE STRING
642+
"Deployment target version for building visionOS tests")
643+
633644
#
634645
# User-configurable debugging options.
635646
#

Runtimes/Resync.cmake

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,23 @@ endforeach()
9696
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Core/Info.plist.in")
9797
copy_files("" "Core" FILES "Info.plist.in")
9898

99+
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Distributed/Info.plist.in")
100+
copy_files("" "Supplemental/Distributed" FILES "Info.plist.in")
101+
102+
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Differentiation/Info.plist.in")
103+
copy_files("" "Supplemental/Differentiation" FILES "Info.plist.in")
104+
105+
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Observation/Info.plist.in")
106+
copy_files("" "Supplemental/Observation" FILES "Info.plist.in")
107+
108+
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/StringProcessing/Info.plist.in")
109+
copy_files("" "Supplemental/StringProcessing" FILES "Info.plist.in")
110+
99111
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Synchronization/Info.plist.in")
100112
copy_files("" "Supplemental/Synchronization" FILES "Info.plist.in")
101113

102-
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Distributed/Info.plist.in")
103-
copy_files("" "Supplemental/Distributed" FILES "Info.plist.in")
114+
message(STATUS "plist[${StdlibSources}/Info.plist.in] -> Supplemental/Volatile/Info.plist.in")
115+
copy_files("" "Supplemental/Volatile" FILES "Info.plist.in")
104116

105117
# Platform Overlays
106118

@@ -155,22 +167,20 @@ copy_files(public/Platform Overlay/Windows/CRT
155167
TiocConstants.swift
156168
tgmath.swift.gyb)
157169

158-
# Supplemental Libraries
159-
copy_library_sources(Synchronization "public" "Supplemental")
160-
copy_library_sources(Observation "public" "Supplemental")
161-
162-
# Copy Differentiation sources
163-
copy_library_sources("linker-support" "" "Supplemental/Differentiation")
164-
copy_library_sources("Differentiation" "public" "Supplemental")
165-
166-
# Copy StringProcessing, RegexParser, RegexBuilder
167170
if(NOT DEFINED StringProcessing_ROOT_DIR)
168171
find_path(StringProcessing_ROOT_DIR
169172
"swift-experimental-string-processing/Package.swift"
170173
HINTS "${CMAKE_CURRENT_LIST_DIR}/../../")
171174
endif()
172175
message(STATUS "String Processing Root: ${StringProcessing_ROOT_DIR}")
173176

177+
# Supplemental Libraries
178+
copy_library_sources(Differentiation "public" "Supplemental")
179+
copy_library_sources(Distributed "public" "Supplemental")
180+
copy_library_sources(Observation "public" "Supplemental")
181+
copy_library_sources(Synchronization "public" "Supplemental")
182+
copy_library_sources(Volatile "public" "Supplemental")
183+
174184
copy_library_sources(_RegexParser "Sources" "Supplemental/StringProcessing"
175185
ROOT "${StringProcessing_ROOT_DIR}/swift-experimental-string-processing")
176186
copy_library_sources(_StringProcessing "Sources" "Supplemental/StringProcessing"
@@ -180,5 +190,5 @@ copy_library_sources(_CUnicode "Sources" "Supplemental/StringProcessing/_StringP
180190
copy_library_sources(RegexBuilder "Sources" "Supplemental/StringProcessing"
181191
ROOT "${StringProcessing_ROOT_DIR}/swift-experimental-string-processing")
182192

183-
copy_library_sources("Distributed" "public" "Supplemental")
193+
copy_library_sources("linker-support" "" "Supplemental/Differentiation")
184194
copy_library_sources(include "" "Supplemental/Distributed")

Runtimes/Supplemental/Differentiation/Info.plist.in

Lines changed: 0 additions & 16 deletions
This file was deleted.

Runtimes/Supplemental/Observation/Info.plist.in

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
cmake_minimum_required(VERSION 3.29)
2+
# TODO before requiring CMake 4.1 or later
3+
# and/or enforcing CMP0195, please check/update
4+
# the implementation of `emit_swift_interface`
5+
# in `EmitSwiftInterface.cmake`
6+
# to ensure it keeps laying down nested swiftmodule folders
7+
8+
if(POLICY CMP0157 AND CMAKE_Swift_COMPILER_USE_OLD_DRIVER)
9+
cmake_policy(SET CMP0157 OLD)
10+
endif()
11+
12+
if($ENV{BUILD_NUMBER})
13+
math(EXPR BUILD_NUMBER "$ENV{BUILD_NUMBER} % 65535")
14+
set(BUILD_NUMBER ".${BUILD_NUMBER}")
15+
endif()
16+
project(SwiftVolatile
17+
LANGUAGES Swift
18+
VERSION 6.1.0${BUILD_NUMBER})
19+
# FIXME(compnerd) this is a workaround for `GNUInstallDirs` which cannot be used
20+
# with a pure Swift project.
21+
enable_language(C)
22+
23+
if(NOT PROJECT_IS_TOP_LEVEL)
24+
message(SEND_ERROR "Swift Observation must build as a standalone project")
25+
endif()
26+
27+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/modules")
28+
29+
set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR
30+
"${PROJECT_SOURCE_DIR}/../../../"
31+
CACHE FILEPATH "Path to the root source directory of the Swift compiler")
32+
33+
# Hook point for vendor-specific extensions to the build system
34+
# Allowed extension points:
35+
# - DefaultSettings.cmake
36+
# - Settings.cmake
37+
set(${PROJECT_NAME}_VENDOR_MODULE_DIR "${CMAKE_SOURCE_DIR}/../cmake/modules/vendor"
38+
CACHE FILEPATH "Location for private build system extension")
39+
40+
find_package(SwiftCore REQUIRED)
41+
find_package(SwiftOverlay REQUIRED)
42+
43+
include(GNUInstallDirs)
44+
45+
include(AvailabilityMacros)
46+
include(EmitSwiftInterface)
47+
include(InstallSwiftInterface)
48+
include(PlatformInfo)
49+
include(gyb)
50+
include(ResourceEmbedding)
51+
include(CatalystSupport)
52+
53+
option(${PROJECT_NAME}_INSTALL_NESTED_SUBDIR "Install libraries under a platform and architecture subdirectory" ON)
54+
set(${PROJECT_NAME}_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${${PROJECT_NAME}_INSTALL_NESTED_SUBDIR}>:/${${PROJECT_NAME}_PLATFORM_SUBDIR}/${${PROJECT_NAME}_ARCH_SUBDIR}>" CACHE STRING "")
55+
set(${PROJECT_NAME}_INSTALL_SWIFTMODULEDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${${PROJECT_NAME}_INSTALL_NESTED_SUBDIR}>:/${${PROJECT_NAME}_PLATFORM_SUBDIR}>" CACHE STRING "")
56+
57+
include("${${PROJECT_NAME}_VENDOR_MODULE_DIR}/Settings.cmake" OPTIONAL)
58+
59+
option(${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION "Generate ABI resilient runtime libraries"
60+
${SwiftCore_ENABLE_LIBRARY_EVOLUTION})
61+
62+
option(${PROJECT_NAME}_ENABLE_PRESPECIALIZATION "Enable generic metadata prespecialization"
63+
${SwiftCore_ENABLE_PRESPECIALIZATION})
64+
65+
add_compile_options(
66+
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>
67+
$<$<COMPILE_LANGUAGE:Swift>:-nostdlibimport>
68+
$<$<COMPILE_LANGUAGE:Swift>:-enable-builtin-module>
69+
$<$<COMPILE_LANGUAGE:Swift>:-strict-memory-safety>
70+
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION}>,$<COMPILE_LANGUAGE:Swift>>:-enable-library-evolution>"
71+
"$<$<AND:$<BOOL:${${PROJECT_NAME}_ENABLE_PRESPECIALIZATION}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -prespecialize-generic-metadata>")
72+
73+
# LNK4049: symbol 'symbol' defined in 'filename.obj' is imported
74+
# LNK4286: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj'
75+
# LNK4217: symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' in function 'function'
76+
#
77+
# We cannot selectively filter the linker warnings as we do not use the MSVC
78+
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
79+
# a compromise, treat all linker warnings as errors.
80+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
81+
82+
add_library(swift_Volatile
83+
Volatile.swift)
84+
set_target_properties(swift_Volatile PROPERTIES
85+
Swift_MODULE_NAME _Volatile)
86+
target_compile_options(swift_Volatile PRIVATE
87+
-parse-stdlib)
88+
target_link_libraries(swift_Volatile PRIVATE
89+
swiftCore)
90+
91+
install(TARGETS swift_Volatile
92+
EXPORT SwiftVolatileTargets
93+
COMPONENT ${PROJECT_NAME}_runtime
94+
ARCHIVE DESTINATION "${${PROJECT_NAME}_INSTALL_LIBDIR}"
95+
LIBRARY DESTINATION "${${PROJECT_NAME}_INSTALL_LIBDIR}"
96+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
97+
emit_swift_interface(swift_Volatile)
98+
install_swift_interface(swift_Volatile)
99+
100+
# Configure plist creation for Darwin platforms.
101+
generate_plist("${CMAKE_PROJECT_NAME}" "${CMAKE_PROJECT_VERSION}" swift_Volatile)
102+
embed_manifest(swift_Volatile)
103+
104+
include("${${PROJECT_NAME}_VENDOR_MODULE_DIR}/swift_Volatile.cmake" OPTIONAL)

0 commit comments

Comments
 (0)