File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import TSCBasic
2
2
import Build
3
3
import TSCUtility
4
+ import Foundation
4
5
5
6
public enum DestinationError : Swift . Error {
6
7
/// Couldn't find the Xcode installation.
@@ -57,16 +58,16 @@ public struct Destination: Encodable {
57
58
private static func hostBinDir(
58
59
originalWorkingDirectory: AbsolutePath ? = localFileSystem. currentWorkingDirectory
59
60
) -> AbsolutePath {
61
+ if let toolchainDir = ProcessInfo . processInfo. environment [ " SWIFT_TOOLCHAIN_PATH " ] {
62
+ return AbsolutePath ( toolchainDir)
63
+ }
60
64
#if Xcode
61
65
// For Xcode, set bin directory to the build directory containing the fake
62
66
// toolchain created during bootstraping. This is obviously not production ready
63
67
// and only exists as a development utility right now.
64
68
//
65
69
// This also means that we should have bootstrapped with the same Swift toolchain
66
70
// we're using inside Xcode otherwise we will not be able to load the runtime libraries.
67
- //
68
- // FIXME: We may want to allow overriding this using an env variable but that
69
- // doesn't seem urgent or extremely useful as of now.
70
71
return AbsolutePath ( #file) . parentDirectory
71
72
. parentDirectory. parentDirectory. appending ( components: " .build " , hostTargetTriple. tripleString, " debug " )
72
73
#else
You can’t perform that action at this time.
0 commit comments