File tree Expand file tree Collapse file tree 10 files changed +32
-45
lines changed Expand file tree Collapse file tree 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)
3737add_subdirectory (swift-test )
3838add_subdirectory (SwiftSDKCommand)
3939add_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
5959 SourceControl
6060 TSCBasic
6161 TSCUtility
62- Workspace)
63-
64- target_compile_definitions (Commands
65- PRIVATE DISABLE_XCBUILD_SUPPORT)
66-
62+ Workspace
63+ XCBuildSupport)
6764target_link_libraries (Commands PRIVATE
6865 DriverSupport
6966 $<$<NOT :$<PLATFORM_ID:Darwin>>:FoundationXML>)
Original file line number Diff line number Diff line change @@ -15,10 +15,7 @@ import Basics
1515import CoreCommands
1616import Foundation
1717import PackageModel
18-
19- #if !DISABLE_XCBUILD_SUPPORT
2018import XCBuildSupport
21- #endif
2219
2320struct DumpSymbolGraph : SwiftCommand {
2421 static let configuration = CommandConfiguration (
@@ -139,7 +136,6 @@ struct DumpPIF: SwiftCommand {
139136 var preserveStructure : Bool = false
140137
141138 func run( _ swiftCommandState: SwiftCommandState ) throws {
142- #if !DISABLE_XCBUILD_SUPPORT
143139 let graph = try swiftCommandState. loadPackageGraph ( )
144140 let pif = try PIFBuilder . generatePIF (
145141 buildParameters: swiftCommandState. productsBuildParameters,
@@ -148,9 +144,6 @@ struct DumpPIF: SwiftCommand {
148144 observabilityScope: swiftCommandState. observabilityScope,
149145 preservePIFModelStructure: preserveStructure)
150146 print ( pif)
151- #else
152- fatalError ( " This subcommand is not available on the current platform " )
153- #endif
154147 }
155148
156149 var toolWorkspaceConfiguration : ToolWorkspaceConfiguration {
Original file line number Diff line number Diff line change @@ -20,10 +20,7 @@ import PackageModel
2020import SourceControl
2121import SPMBuildCore
2222import Workspace
23-
24- #if !DISABLE_XCBUILD_SUPPORT
2523import XCBuildSupport
26- #endif
2724
2825import enum TSCUtility. Diagnostics
2926
Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ import Build
1616import CoreCommands
1717import PackageGraph
1818import SPMBuildCore
19-
20- #if !DISABLE_XCBUILD_SUPPORT
2119import XCBuildSupport
22- #endif
2320
2421import class TSCBasic. Process
2522import var TSCBasic. stdoutStream
Original file line number Diff line number Diff line change 1212
1313import Build
1414import SPMBuildCore
15-
16- #if !DISABLE_XCBUILD_SUPPORT
1715import XCBuildSupport
18- #endif
1916
2017import class Basics. ObservabilityScope
2118import struct PackageGraph. ModulesGraph
@@ -63,7 +60,6 @@ private struct NativeBuildSystemFactory: BuildSystemFactory {
6360 }
6461}
6562
66- #if !DISABLE_XCBUILD_SUPPORT
6763private struct XcodeBuildSystemFactory : BuildSystemFactory {
6864 let swiftCommandState : SwiftCommandState
6965
@@ -91,19 +87,12 @@ private struct XcodeBuildSystemFactory: BuildSystemFactory {
9187 )
9288 }
9389}
94- #endif
9590
9691extension SwiftCommandState {
9792 public var defaultBuildSystemProvider : BuildSystemProvider {
98- #if !DISABLE_XCBUILD_SUPPORT
9993 . init( providers: [
10094 . native: NativeBuildSystemFactory ( swiftCommandState: self ) ,
10195 . xcode: XcodeBuildSystemFactory ( swiftCommandState: self )
10296 ] )
103- #else
104- . init( providers: [
105- . native: NativeBuildSystemFactory ( swiftCommandState: self ) ,
106- ] )
107- #endif
10897 }
10998}
Original file line number Diff line number Diff line change @@ -18,11 +18,8 @@ target_link_libraries(CoreCommands PUBLIC
1818 PackageGraph
1919 TSCBasic
2020 TSCUtility
21- Workspace)
22-
23- target_compile_definitions (CoreCommands
24- PRIVATE DISABLE_XCBUILD_SUPPORT)
25-
21+ Workspace
22+ XCBuildSupport)
2623target_link_libraries (CoreCommands PRIVATE
2724 DriverSupport
2825 $<$<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
1717 PackageModel
1818 SwiftDriver
1919 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
2424import PackageLoading
2525import PackageModel
2626import SPMBuildCore
27-
28- #if !DISABLE_XCBUILD_SUPPORT
2927import XCBuildSupport
30- #endif
3128
3229import struct TSCBasic. KeyedPair
3330import func TSCBasic. topologicalSort
@@ -332,7 +329,6 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
332329 observabilityScope: self . observabilityScope
333330 )
334331 case . xcode:
335- #if !DISABLE_XCBUILD_SUPPORT
336332 return try XcodeBuildSystem (
337333 buildParameters: buildParameters,
338334 packageGraphLoader: packageGraphLoader,
@@ -341,9 +337,6 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
341337 fileSystem: self . fileSystem,
342338 observabilityScope: self . observabilityScope
343339 )
344- #else
345- fatalError ( " SwiftPM was built without XCBuild support " )
346- #endif
347340 }
348341 }
349342
You can’t perform that action at this time.
0 commit comments