22
33/*
44 This source file is part of the Swift.org open source project
5-
5+
66 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 */
@@ -21,7 +21,7 @@ if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTTSC_MACOS_DE
2121 macOSPlatform = . macOS( . v10_10)
2222}
2323
24- let CMakeFiles = [ " cmake_install.cmake " , " CMakeLists.txt " , " CMakeFiles " ]
24+ let CMakeFiles = [ " CMakeLists.txt " ]
2525
2626let package = Package (
2727 name: " swift-tools-support-core " ,
@@ -46,9 +46,9 @@ let package = Package(
4646 ] ,
4747 dependencies: [ ] ,
4848 targets: [
49-
49+
5050 // MARK: Tools support core targets
51-
51+
5252 . target(
5353 /** Shim target to import missing C headers in Darwin and Glibc modulemap. */
5454 name: " TSCclibc " ,
@@ -62,24 +62,28 @@ let package = Package(
6262 . target(
6363 /** TSCBasic support library */
6464 name: " TSCBasic " ,
65- dependencies: [ " TSCLibc " , " TSCclibc " ] ,
65+ dependencies: [
66+ " TSCLibc " ,
67+ " TSCclibc " ,
68+ . product( name: " SystemPackage " , package : " swift-system " ) ,
69+ ] ,
6670 exclude: CMakeFiles + [ " README.md " ] ) ,
6771 . target(
6872 /** Abstractions for common operations, should migrate to TSCBasic */
6973 name: " TSCUtility " ,
7074 dependencies: [ " TSCBasic " , " TSCclibc " ] ,
7175 exclude: CMakeFiles) ,
72-
76+
7377 // MARK: Additional Test Dependencies
74-
78+
7579 . target(
7680 /** Generic test support library */
7781 name: " TSCTestSupport " ,
7882 dependencies: [ " TSCBasic " , " TSCUtility " ] ) ,
79-
80-
83+
84+
8185 // MARK: Tools support core tests
82-
86+
8387 . testTarget(
8488 name: " TSCBasicTests " ,
8589 dependencies: [ " TSCTestSupport " , " TSCclibc " ] ,
@@ -97,6 +101,19 @@ let package = Package(
97101 ]
98102)
99103
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 " ) ,
114+ ]
115+ }
116+
100117// FIXME: conditionalise these flags since SwiftPM 5.3 and earlier will crash
101118// for platforms they don't know about.
102119#if os(Windows)
0 commit comments