File tree 10 files changed +32
-45
lines changed 10 files changed +32
-45
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,4 @@ add_subdirectory(swift-run)
37
37
add_subdirectory (swift-test )
38
38
add_subdirectory (SwiftSDKCommand)
39
39
add_subdirectory (Workspace)
40
+ add_subdirectory (XCBuildSupport)
Original file line number Diff line number Diff line change @@ -59,11 +59,8 @@ target_link_libraries(Commands PUBLIC
59
59
SourceControl
60
60
TSCBasic
61
61
TSCUtility
62
- Workspace)
63
-
64
- target_compile_definitions (Commands
65
- PRIVATE DISABLE_XCBUILD_SUPPORT)
66
-
62
+ Workspace
63
+ XCBuildSupport)
67
64
target_link_libraries (Commands PRIVATE
68
65
DriverSupport
69
66
$<$<NOT :$<PLATFORM_ID:Darwin>>:FoundationXML>)
Original file line number Diff line number Diff line change @@ -15,10 +15,7 @@ import Basics
15
15
import CoreCommands
16
16
import Foundation
17
17
import PackageModel
18
-
19
- #if !DISABLE_XCBUILD_SUPPORT
20
18
import XCBuildSupport
21
- #endif
22
19
23
20
struct DumpSymbolGraph : SwiftCommand {
24
21
static let configuration = CommandConfiguration (
@@ -139,7 +136,6 @@ struct DumpPIF: SwiftCommand {
139
136
var preserveStructure : Bool = false
140
137
141
138
func run( _ swiftCommandState: SwiftCommandState ) throws {
142
- #if !DISABLE_XCBUILD_SUPPORT
143
139
let graph = try swiftCommandState. loadPackageGraph ( )
144
140
let pif = try PIFBuilder . generatePIF (
145
141
buildParameters: swiftCommandState. productsBuildParameters,
@@ -148,9 +144,6 @@ struct DumpPIF: SwiftCommand {
148
144
observabilityScope: swiftCommandState. observabilityScope,
149
145
preservePIFModelStructure: preserveStructure)
150
146
print ( pif)
151
- #else
152
- fatalError ( " This subcommand is not available on the current platform " )
153
- #endif
154
147
}
155
148
156
149
var toolWorkspaceConfiguration : ToolWorkspaceConfiguration {
Original file line number Diff line number Diff line change @@ -20,10 +20,7 @@ import PackageModel
20
20
import SourceControl
21
21
import SPMBuildCore
22
22
import Workspace
23
-
24
- #if !DISABLE_XCBUILD_SUPPORT
25
23
import XCBuildSupport
26
- #endif
27
24
28
25
import enum TSCUtility. Diagnostics
29
26
Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ import Build
16
16
import CoreCommands
17
17
import PackageGraph
18
18
import SPMBuildCore
19
-
20
- #if !DISABLE_XCBUILD_SUPPORT
21
19
import XCBuildSupport
22
- #endif
23
20
24
21
import class TSCBasic. Process
25
22
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
17
15
import XCBuildSupport
18
- #endif
19
16
20
17
import class Basics. ObservabilityScope
21
18
import struct PackageGraph. ModulesGraph
@@ -63,7 +60,6 @@ private struct NativeBuildSystemFactory: BuildSystemFactory {
63
60
}
64
61
}
65
62
66
- #if !DISABLE_XCBUILD_SUPPORT
67
63
private struct XcodeBuildSystemFactory : BuildSystemFactory {
68
64
let swiftCommandState : SwiftCommandState
69
65
@@ -91,19 +87,12 @@ private struct XcodeBuildSystemFactory: BuildSystemFactory {
91
87
)
92
88
}
93
89
}
94
- #endif
95
90
96
91
extension SwiftCommandState {
97
92
public var defaultBuildSystemProvider : BuildSystemProvider {
98
- #if !DISABLE_XCBUILD_SUPPORT
99
93
. init( providers: [
100
94
. native: NativeBuildSystemFactory ( swiftCommandState: self ) ,
101
95
. xcode: XcodeBuildSystemFactory ( swiftCommandState: self )
102
96
] )
103
- #else
104
- . init( providers: [
105
- . native: NativeBuildSystemFactory ( swiftCommandState: self ) ,
106
- ] )
107
- #endif
108
97
}
109
98
}
Original file line number Diff line number Diff line change @@ -18,11 +18,8 @@ target_link_libraries(CoreCommands PUBLIC
18
18
PackageGraph
19
19
TSCBasic
20
20
TSCUtility
21
- Workspace)
22
-
23
- target_compile_definitions (CoreCommands
24
- PRIVATE DISABLE_XCBUILD_SUPPORT)
25
-
21
+ Workspace
22
+ XCBuildSupport)
26
23
target_link_libraries (CoreCommands PRIVATE
27
24
DriverSupport
28
25
$<$<NOT :$<PLATFORM_ID:Darwin>>:FoundationXML>)
Original file line number Diff line number Diff line change
1
+ # This source file is part of the Swift open source project
2
+ #
3
+ # Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
4
+ # Licensed under Apache License v2.0 with Runtime Library Exception
5
+ #
6
+ # See http://swift.org/LICENSE.txt for license information
7
+ # See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8
+
9
+ add_library (XCBuildSupport STATIC
10
+ PIF.swift
11
+ PIFBuilder.swift
12
+ XCBuildDelegate.swift
13
+ XCBuildMessage.swift
14
+ XCBuildOutputParser.swift
15
+ XcodeBuildSystem.swift)
16
+ target_link_libraries (XCBuildSupport PUBLIC
17
+ Build
18
+ DriverSupport
19
+ TSCBasic
20
+ TSCUtility
21
+ PackageGraph
22
+ )
23
+
24
+ set_target_properties (XCBuildSupport PROPERTIES
25
+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
Original file line number Diff line number Diff line change @@ -17,7 +17,5 @@ target_link_libraries(swift-bootstrap PRIVATE
17
17
PackageModel
18
18
SwiftDriver
19
19
TSCBasic
20
- TSCUtility)
21
-
22
- target_compile_definitions (swift-bootstrap
23
- PRIVATE DISABLE_XCBUILD_SUPPORT)
20
+ TSCUtility
21
+ XCBuildSupport)
Original file line number Diff line number Diff line change @@ -24,10 +24,7 @@ import PackageGraph
24
24
import PackageLoading
25
25
import PackageModel
26
26
import SPMBuildCore
27
-
28
- #if !DISABLE_XCBUILD_SUPPORT
29
27
import XCBuildSupport
30
- #endif
31
28
32
29
import struct TSCBasic. KeyedPair
33
30
import func TSCBasic. topologicalSort
@@ -332,7 +329,6 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
332
329
observabilityScope: self . observabilityScope
333
330
)
334
331
case . xcode:
335
- #if !DISABLE_XCBUILD_SUPPORT
336
332
return try XcodeBuildSystem (
337
333
buildParameters: buildParameters,
338
334
packageGraphLoader: packageGraphLoader,
@@ -341,9 +337,6 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
341
337
fileSystem: self . fileSystem,
342
338
observabilityScope: self . observabilityScope
343
339
)
344
- #else
345
- fatalError ( " SwiftPM was built without XCBuild support " )
346
- #endif
347
340
}
348
341
}
349
342
You can’t perform that action at this time.
0 commit comments