Skip to content

Commit 950ad71

Browse files
committed
remove unnecessary TSCLibc dependency
These modules did not use any of the `TSCLibc` interfaces but relied on the module's re-exported libc import. Simply inline that and remove the dependency on `TSCLibc`. On Linux and Apple platforms, this does not have much impact, however, Windows does not support static linking of Swift content yet. As a result, this avoids an unnecessary dynamic library being linked and increasing the dirty memory of the process.
1 parent d1c5147 commit 950ad71

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Sources/swift-build-sdk-interfaces/main.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212
import SwiftDriverExecution
1313
import SwiftDriver
14-
import TSCLibc
14+
#if os(Windows)
15+
import CRT
16+
#elseif os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
17+
import Darwin
18+
#else
19+
import Glibc
20+
#endif
1521
import TSCBasic
1622
import TSCUtility
1723

Sources/swift-driver/main.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import SwiftDriverExecution
1313
import SwiftDriver
1414

15-
import TSCLibc
1615
import TSCBasic
1716
import TSCUtility
1817

0 commit comments

Comments
 (0)