1- // swift-tools-version:5.2
1+ // swift-tools-version:5.4
22
33/*
44 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
77 Licensed under Apache License v2.0 with Runtime Library Exception
8-
8+
99 See http://swift.org/LICENSE.txt for license information
1010 See http://swift.org/CONTRIBUTORS.txt for Swift project authors
1111 */
1212
1313
1414import 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 " ]
1525
1626let package = Package (
1727 name: " swift-tools-support-core " ,
28+ platforms: [
29+ macOSPlatform,
30+ ] ,
1831 products: [
32+ . library(
33+ name: " TSCBasic " ,
34+ targets: [ " TSCBasic " ] ) ,
1935 . library(
2036 name: " SwiftToolsSupport " ,
2137 type: . dynamic,
@@ -28,44 +44,50 @@ let package = Package(
2844 name: " TSCTestSupport " ,
2945 targets: [ " TSCTestSupport " ] ) ,
3046 ] ,
31- dependencies: [
32- . package ( url: " https://github.com/apple/swift-system.git " , . upToNextMinor( from: " 0.0.1 " ) )
33- ] ,
3447 targets: [
35-
48+
3649 // MARK: Tools support core targets
37-
50+
3851 . target(
3952 /** Shim target to import missing C headers in Darwin and Glibc modulemap. */
4053 name: " TSCclibc " ,
41- dependencies: [ ] ) ,
54+ dependencies: [ ] ,
55+ exclude: CMakeFiles) ,
4256 . target(
4357 /** Cross-platform access to bare `libc` functionality. */
4458 name: " TSCLibc " ,
45- dependencies: [ ] ) ,
59+ dependencies: [ ] ,
60+ exclude: CMakeFiles) ,
4661 . target(
4762 /** TSCBasic support library */
4863 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 " ) ] ) ,
5171 . target(
5272 /** Abstractions for common operations, should migrate to TSCBasic */
5373 name: " TSCUtility " ,
54- dependencies: [ " TSCBasic " , " TSCclibc " ] ) ,
55-
74+ dependencies: [ " TSCBasic " , " TSCclibc " ] ,
75+ exclude: CMakeFiles) ,
76+
5677 // MARK: Additional Test Dependencies
57-
78+
5879 . target(
5980 /** Generic test support library */
6081 name: " TSCTestSupport " ,
6182 dependencies: [ " TSCBasic " , " TSCUtility " ] ) ,
62-
63-
83+
84+
6485 // MARK: Tools support core tests
65-
86+
6687 . testTarget(
6788 name: " TSCBasicTests " ,
68- dependencies: [ " TSCTestSupport " , " TSCclibc " ] ) ,
89+ dependencies: [ " TSCTestSupport " , " TSCclibc " ] ,
90+ exclude: [ " processInputs " , " Inputs " ] ) ,
6991 . testTarget(
7092 name: " TSCBasicPerformanceTests " ,
7193 dependencies: [ " TSCBasic " , " TSCTestSupport " ] ) ,
@@ -74,16 +96,20 @@ let package = Package(
7496 dependencies: [ " TSCTestSupport " ] ) ,
7597 . testTarget(
7698 name: " TSCUtilityTests " ,
77- dependencies: [ " TSCUtility " , " TSCTestSupport " ] ) ,
99+ dependencies: [ " TSCUtility " , " TSCTestSupport " ] ,
100+ exclude: [ " pkgconfigInputs " , " Inputs " ] ) ,
78101 ]
79102)
80103
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 " ) ,
87114 ]
88- }
89- #endif
115+ }
0 commit comments