Skip to content

Commit c89a86e

Browse files
committed
build: use Foundation instead of C for getenv
`getenv` is different across different platforms. Use Foundation to abstract over the platform differences.
1 parent ce90205 commit c89a86e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
import PackageDescription
44
import Foundation
55

6-
#if canImport(Glibc)
7-
import Glibc
8-
#else
9-
import Darwin.C
10-
#endif
11-
126
let package = Package(
137
name: "SwiftSyntax",
148
targets: [
@@ -26,7 +20,7 @@ let swiftSyntaxTarget: PackageDescription.Target
2620

2721
/// If we are in a controlled CI environment, we can use internal compiler flags
2822
/// to speed up the build or improve it.
29-
if getenv("SWIFT_BUILD_SCRIPT_ENVIRONMENT") != nil {
23+
if ProcessInfo.processInfo.environment("SWIFT_BUILD_SCRIPT_ENVIRONMENT") != nil {
3024
let groupFile = URL(fileURLWithPath: #file)
3125
.deletingLastPathComponent()
3226
.appendingPathComponent("utils")

0 commit comments

Comments
 (0)