File tree 10 files changed +45
-31
lines changed 10 files changed +45
-31
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,3 @@ add_subdirectory(swift-package)
37
37
add_subdirectory (swift-run)
38
38
add_subdirectory (swift-test )
39
39
add_subdirectory (Workspace)
40
- add_subdirectory (XCBuildSupport)
Original file line number Diff line number Diff line change @@ -59,8 +59,11 @@ target_link_libraries(Commands PUBLIC
59
59
SourceControl
60
60
TSCBasic
61
61
TSCUtility
62
- Workspace
63
- XCBuildSupport)
62
+ Workspace)
63
+
64
+ target_compile_definitions (Commands
65
+ PRIVATE DISABLE_XCBUILD_SUPPORT)
66
+
64
67
target_link_libraries (Commands PRIVATE
65
68
DriverSupport
66
69
$<$<NOT :$<PLATFORM_ID:Darwin>>:FoundationXML>)
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ import Basics
15
15
import CoreCommands
16
16
import Foundation
17
17
import PackageModel
18
+
19
+ #if !DISABLE_XCBUILD_SUPPORT
18
20
import XCBuildSupport
21
+ #endif
19
22
20
23
struct DumpSymbolGraph : SwiftCommand {
21
24
static let configuration = CommandConfiguration (
@@ -136,6 +139,7 @@ struct DumpPIF: SwiftCommand {
136
139
var preserveStructure : Bool = false
137
140
138
141
func run( _ swiftTool: SwiftTool ) throws {
142
+ #if !DISABLE_XCBUILD_SUPPORT
139
143
let graph = try swiftTool. loadPackageGraph ( )
140
144
let pif = try PIFBuilder . generatePIF (
141
145
buildParameters: swiftTool. productsBuildParameters,
@@ -144,6 +148,9 @@ struct DumpPIF: SwiftCommand {
144
148
observabilityScope: swiftTool. observabilityScope,
145
149
preservePIFModelStructure: preserveStructure)
146
150
print ( pif)
151
+ #else
152
+ fatalError ( " This subcommand is not available on the current platform " )
153
+ #endif
147
154
}
148
155
149
156
var toolWorkspaceConfiguration : ToolWorkspaceConfiguration {
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ import PackageModel
20
20
import SourceControl
21
21
import SPMBuildCore
22
22
import Workspace
23
+
24
+ #if !DISABLE_XCBUILD_SUPPORT
23
25
import XCBuildSupport
26
+ #endif
24
27
25
28
import enum TSCUtility. Diagnostics
26
29
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ import Build
16
16
import CoreCommands
17
17
import PackageGraph
18
18
import SPMBuildCore
19
+
20
+ #if !DISABLE_XCBUILD_SUPPORT
19
21
import XCBuildSupport
22
+ #endif
20
23
21
24
import class TSCBasic. Process
22
25
import var TSCBasic. stdoutStream
Original file line number Diff line number Diff line change 12
12
13
13
import Build
14
14
import SPMBuildCore
15
+
16
+ #if !DISABLE_XCBUILD_SUPPORT
15
17
import XCBuildSupport
18
+ #endif
16
19
17
20
import class Basics. ObservabilityScope
18
21
import struct PackageGraph. PackageGraph
@@ -60,6 +63,7 @@ private struct NativeBuildSystemFactory: BuildSystemFactory {
60
63
}
61
64
}
62
65
66
+ #if !DISABLE_XCBUILD_SUPPORT
63
67
private struct XcodeBuildSystemFactory : BuildSystemFactory {
64
68
let swiftTool : SwiftTool
65
69
@@ -87,12 +91,19 @@ private struct XcodeBuildSystemFactory: BuildSystemFactory {
87
91
)
88
92
}
89
93
}
94
+ #endif
90
95
91
96
extension SwiftTool {
92
97
public var defaultBuildSystemProvider : BuildSystemProvider {
98
+ #if !DISABLE_XCBUILD_SUPPORT
93
99
. init( providers: [
94
100
. native: NativeBuildSystemFactory ( swiftTool: self ) ,
95
101
. xcode: XcodeBuildSystemFactory ( swiftTool: self )
96
102
] )
103
+ #else
104
+ . init( providers: [
105
+ . native: NativeBuildSystemFactory ( swiftTool: self ) ,
106
+ ] )
107
+ #endif
97
108
}
98
109
}
Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ target_link_libraries(CoreCommands PUBLIC
18
18
PackageGraph
19
19
TSCBasic
20
20
TSCUtility
21
- Workspace
22
- XCBuildSupport)
21
+ Workspace)
22
+
23
+ target_compile_definitions (CoreCommands
24
+ PRIVATE DISABLE_XCBUILD_SUPPORT)
25
+
23
26
target_link_libraries (CoreCommands PRIVATE
24
27
DriverSupport
25
28
$<$<NOT :$<PLATFORM_ID:Darwin>>:FoundationXML>)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,5 +16,7 @@ target_link_libraries(swift-bootstrap PRIVATE
16
16
PackageLoading
17
17
PackageModel
18
18
TSCBasic
19
- TSCUtility
20
- XCBuildSupport)
19
+ TSCUtility)
20
+
21
+ target_compile_definitions (swift-bootstrap
22
+ PRIVATE DISABLE_XCBUILD_SUPPORT)
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ import PackageGraph
20
20
import PackageLoading
21
21
import PackageModel
22
22
import SPMBuildCore
23
+
24
+ #if !DISABLE_XCBUILD_SUPPORT
23
25
import XCBuildSupport
26
+ #endif
24
27
25
28
import struct TSCBasic. KeyedPair
26
29
import func TSCBasic. topologicalSort
@@ -322,6 +325,7 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
322
325
observabilityScope: self . observabilityScope
323
326
)
324
327
case . xcode:
328
+ #if !DISABLE_XCBUILD_SUPPORT
325
329
return try XcodeBuildSystem (
326
330
buildParameters: buildParameters,
327
331
packageGraphLoader: packageGraphLoader,
@@ -330,6 +334,9 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
330
334
fileSystem: self . fileSystem,
331
335
observabilityScope: self . observabilityScope
332
336
)
337
+ #else
338
+ fatalError ( " SwiftPM was built without XCBuild support " )
339
+ #endif
333
340
}
334
341
}
335
342
You can’t perform that action at this time.
0 commit comments