File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,19 @@ automatic linking type with `-auto` suffix appended to product's name.
7373*/
7474let autoProducts = [ swiftPMProduct, swiftPMDataModelProduct]
7575
76+
77+ let packageModelResourcesSettings : [ SwiftSetting ]
78+ let packageModelResources : [ Resource ]
79+ if ProcessInfo . processInfo. environment [ " SWIFTPM_USE_LIBRARIES_METADATA " ] == nil {
80+ packageModelResources = [ ]
81+ packageModelResourcesSettings = [ . define( " SKIP_RESOURCE_SUPPORT " ) ]
82+ } else {
83+ packageModelResources = [
84+ . copy( " InstalledLibrariesSupport/provided-libraries.json " ) ,
85+ ]
86+ packageModelResourcesSettings = [ ]
87+ }
88+
7689let package = Package (
7790 name: " SwiftPM " ,
7891 platforms: [
@@ -218,9 +231,8 @@ let package = Package(
218231 name: " PackageModel " ,
219232 dependencies: [ " Basics " ] ,
220233 exclude: [ " CMakeLists.txt " , " README.md " ] ,
221- resources: [
222- . copy( " InstalledLibrariesSupport/provided-libraries.json " ) ,
223- ]
234+ resources: packageModelResources,
235+ swiftSettings: packageModelResourcesSettings
224236 ) ,
225237
226238 . target(
Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ public final class UserToolchain: Toolchain {
545545 if let customProvidedLibraries {
546546 self . providedLibraries = customProvidedLibraries
547547 } else {
548- // When building with CMake, we need to skip resource support.
548+ // When building with CMake or `swift build --build-system xcode` , we need to skip resource support.
549549 #if SKIP_RESOURCE_SUPPORT
550550 let path = self . swiftCompilerPath. parentDirectory. parentDirectory. appending ( components: [ " share " , " pm " , " provided-libraries.json " ] )
551551 #else
You can’t perform that action at this time.
0 commit comments