Skip to content

Commit 2fc5cbd

Browse files
committed
stdlib: remove swiftMSVCRT, replace with swiftCRT on Windows
This replaces swiftMSVCRT with swiftCRT. The big difference here is that the `visualc` module is no longer imported nor exported. The `visualc` module remains in use for a singular test wrt availability, but this should effectively remove the need for the `visualc` module. The difference between the MSVCRT and ucrt module was not well understood by most. MSVCRT provided ucrt AND visualc, combining pieces of the old MSVCRT and the newer ucrt. The ucrt module is what you really wanted most of the time, however, would need to use MSVCRT for the convenience aliases for type-generic math and the deprecated math constants. Unfortunately, we cannot shadow the `ucrt` module and create a Swift SDK overlay for ucrt as that seems to result in circular dependencies when processing the `_Concurrency` module. Although this makes using the C library easier for most people, it has a more important subtle change: it cleaves the dependency on visualc. This means that this enables use of Swift without Visual Studio for the singular purpose of providing 3 header files. Additionally, it removes the need for the installation of 2 of the 4 support files. This greatly simplifies the deployment process on Windows.
1 parent faa6289 commit 2fc5cbd

Some content is hidden

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

44 files changed

+43
-48
lines changed

stdlib/private/RuntimeUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ add_swift_target_library(swiftRuntimeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
1313
SWIFT_MODULE_DEPENDS_OPENBSD Glibc
1414
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
1515
SWIFT_MODULE_DEPENDS_HAIKU Glibc
16-
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT
16+
SWIFT_MODULE_DEPENDS_WINDOWS CRT
1717
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
1818
INSTALL_IN_COMPONENT stdlib-experimental
1919
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ add_swift_target_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BU
2424
SWIFT_MODULE_DEPENDS_OPENBSD Glibc
2525
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
2626
SWIFT_MODULE_DEPENDS_HAIKU Glibc
27-
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT
27+
SWIFT_MODULE_DEPENDS_WINDOWS CRT
2828
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
2929
INSTALL_IN_COMPONENT stdlib-experimental
3030
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")

stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ add_swift_target_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD
1212
SWIFT_MODULE_DEPENDS_OPENBSD Glibc
1313
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
1414
SWIFT_MODULE_DEPENDS_HAIKU Glibc
15-
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT
15+
SWIFT_MODULE_DEPENDS_WINDOWS CRT
1616
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
1717
INSTALL_IN_COMPONENT stdlib-experimental
1818
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
4141
SWIFT_MODULE_DEPENDS_OPENBSD Glibc
4242
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
4343
SWIFT_MODULE_DEPENDS_HAIKU Glibc
44-
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT WinSDK
44+
SWIFT_MODULE_DEPENDS_WINDOWS CRT WinSDK
4545
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
4646
INSTALL_IN_COMPONENT stdlib-experimental
4747
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")

stdlib/private/StdlibUnittest/RaceTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import Darwin
4444
#elseif canImport(Glibc)
4545
import Glibc
4646
#elseif os(Windows)
47-
import MSVCRT
47+
import CRT
4848
import WinSDK
4949
#endif
5050

stdlib/private/StdlibUnittest/StdlibCoreExtras.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Darwin
1717
#elseif canImport(Glibc)
1818
import Glibc
1919
#elseif os(Windows)
20-
import MSVCRT
20+
import CRT
2121
#endif
2222

2323
#if _runtime(_ObjC)

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Darwin
2121
#elseif canImport(Glibc)
2222
import Glibc
2323
#elseif os(Windows)
24-
import MSVCRT
24+
import CRT
2525
import WinSDK
2626
#endif
2727

stdlib/private/StdlibUnittest/SymbolLookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#elseif canImport(Glibc)
1616
import Glibc
1717
#elseif os(Windows)
18-
import MSVCRT
18+
import CRT
1919
import WinSDK
2020
#else
2121
#error("Unsupported platform")

stdlib/private/SwiftPrivate/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
1515
GYB_SOURCES
1616
AtomicInt.swift.gyb
1717

18-
SWIFT_MODULE_DEPENDS_WINDOWS MSVCRT WinSDK
18+
SWIFT_MODULE_DEPENDS_WINDOWS CRT WinSDK
1919
SWIFT_COMPILE_FLAGS ${swift_swiftprivate_compile_flags} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
2020
INSTALL_IN_COMPONENT stdlib-experimental
2121
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")

stdlib/private/SwiftPrivate/IO.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Swift
1414
import SwiftShims
1515

1616
#if os(Windows)
17-
import MSVCRT
17+
import CRT
1818
import WinSDK
1919
#endif
2020

0 commit comments

Comments
 (0)