1
- // swift-tools-version:5.2
1
+ // swift-tools-version:5.4
2
2
3
3
/*
4
4
This source file is part of the Swift.org open source project
5
-
6
- Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors
5
+
6
+ Copyright (c) 2019 - 2021 Apple Inc. and the Swift project authors
7
7
Licensed under Apache License v2.0 with Runtime Library Exception
8
-
8
+
9
9
See http://swift.org/LICENSE.txt for license information
10
10
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
11
11
*/
12
12
13
13
14
14
import PackageDescription
15
+ import class Foundation. ProcessInfo
16
+
17
+ let macOSPlatform : SupportedPlatform
18
+ if let deploymentTarget = ProcessInfo . processInfo. environment [ " SWIFTTSC_MACOS_DEPLOYMENT_TARGET " ] {
19
+ macOSPlatform = . macOS( deploymentTarget)
20
+ } else {
21
+ macOSPlatform = . macOS( . v10_10)
22
+ }
23
+
24
+ let CMakeFiles = [ " CMakeLists.txt " ]
15
25
16
26
let package = Package (
17
27
name: " swift-tools-support-core " ,
28
+ platforms: [
29
+ macOSPlatform,
30
+ ] ,
18
31
products: [
32
+ . library(
33
+ name: " TSCBasic " ,
34
+ targets: [ " TSCBasic " ] ) ,
19
35
. library(
20
36
name: " SwiftToolsSupport " ,
21
37
type: . dynamic,
@@ -28,44 +44,50 @@ let package = Package(
28
44
name: " TSCTestSupport " ,
29
45
targets: [ " TSCTestSupport " ] ) ,
30
46
] ,
31
- dependencies: [
32
- . package ( url: " https://github.com/apple/swift-system.git " , . upToNextMinor( from: " 0.0.1 " ) )
33
- ] ,
34
47
targets: [
35
-
48
+
36
49
// MARK: Tools support core targets
37
-
50
+
38
51
. target(
39
52
/** Shim target to import missing C headers in Darwin and Glibc modulemap. */
40
53
name: " TSCclibc " ,
41
- dependencies: [ ] ) ,
54
+ dependencies: [ ] ,
55
+ exclude: CMakeFiles) ,
42
56
. target(
43
57
/** Cross-platform access to bare `libc` functionality. */
44
58
name: " TSCLibc " ,
45
- dependencies: [ ] ) ,
59
+ dependencies: [ ] ,
60
+ exclude: CMakeFiles) ,
46
61
. target(
47
62
/** TSCBasic support library */
48
63
name: " TSCBasic " ,
49
- dependencies: [ " TSCLibc " , " TSCclibc " ,
50
- . product( name: " SystemPackage " , package : " swift-system " ) ] ) ,
64
+ dependencies: [
65
+ " TSCLibc " ,
66
+ " TSCclibc " ,
67
+ . product( name: " SystemPackage " , package : " swift-system " ) ,
68
+ ] ,
69
+ exclude: CMakeFiles + [ " README.md " ] ,
70
+ cxxSettings: [ . define( " _CRT_SECURE_NO_WARNINGS " ) ] ) ,
51
71
. target(
52
72
/** Abstractions for common operations, should migrate to TSCBasic */
53
73
name: " TSCUtility " ,
54
- dependencies: [ " TSCBasic " , " TSCclibc " ] ) ,
55
-
74
+ dependencies: [ " TSCBasic " , " TSCclibc " ] ,
75
+ exclude: CMakeFiles) ,
76
+
56
77
// MARK: Additional Test Dependencies
57
-
78
+
58
79
. target(
59
80
/** Generic test support library */
60
81
name: " TSCTestSupport " ,
61
82
dependencies: [ " TSCBasic " , " TSCUtility " ] ) ,
62
-
63
-
83
+
84
+
64
85
// MARK: Tools support core tests
65
-
86
+
66
87
. testTarget(
67
88
name: " TSCBasicTests " ,
68
- dependencies: [ " TSCTestSupport " , " TSCclibc " ] ) ,
89
+ dependencies: [ " TSCTestSupport " , " TSCclibc " ] ,
90
+ exclude: [ " processInputs " , " Inputs " ] ) ,
69
91
. testTarget(
70
92
name: " TSCBasicPerformanceTests " ,
71
93
dependencies: [ " TSCBasic " , " TSCTestSupport " ] ) ,
@@ -74,16 +96,20 @@ let package = Package(
74
96
dependencies: [ " TSCTestSupport " ] ) ,
75
97
. testTarget(
76
98
name: " TSCUtilityTests " ,
77
- dependencies: [ " TSCUtility " , " TSCTestSupport " ] ) ,
99
+ dependencies: [ " TSCUtility " , " TSCTestSupport " ] ,
100
+ exclude: [ " pkgconfigInputs " , " Inputs " ] ) ,
78
101
]
79
102
)
80
103
81
- // FIXME: conditionalise these flags since SwiftPM 5.3 and earlier will crash
82
- // for platforms they don't know about.
83
- #if os(Windows)
84
- if let TSCBasic = package . targets. first ( where: { $0. name == " TSCBasic " } ) {
85
- TSCBasic . cxxSettings = [
86
- . define( " _CRT_SECURE_NO_WARNINGS " , . when( platforms: [ . windows] ) ) ,
104
+ /// When not using local dependencies, the branch to use for llbuild and TSC repositories.
105
+ let relatedDependenciesBranch = " main "
106
+
107
+ if ProcessInfo . processInfo. environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
108
+ package . dependencies += [
109
+ . package ( url: " https://github.com/apple/swift-system.git " , . upToNextMinor( from: " 1.1.1 " ) ) ,
110
+ ]
111
+ } else {
112
+ package . dependencies += [
113
+ . package ( path: " ../swift-system " ) ,
87
114
]
88
- }
89
- #endif
115
+ }
0 commit comments