Skip to content

Commit 60951f7

Browse files
authored
Merge pull request #116 from compnerd/build-configuration
build: synchronise CMake and Package.swift for Windows
2 parents 2ecf988 + fa171fd commit 60951f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Package.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.2
22

33
/*
44
This source file is part of the Swift.org open source project
@@ -83,3 +83,16 @@ let package = Package(
8383
dependencies: ["TSCUtility", "TSCTestSupport", "TSCTestSupportExecutable"]),
8484
]
8585
)
86+
87+
// FIXME: conditionalise these flags since SwiftPM 5.3 and earlier will crash
88+
// for platforms they don't know about.
89+
#if os(Windows)
90+
if let TSCBasic = package.targets.first(where: { $0.name == "TSCBasic" }) {
91+
TSCBasic.cxxSettings = [
92+
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])),
93+
]
94+
TSCBasic.linkerSettings = [
95+
.linkedLibrary("Pathcch", .when(platforms: [.windows])),
96+
]
97+
}
98+
#endif

0 commit comments

Comments
 (0)