File tree 2 files changed +16
-4
lines changed
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.
73
73
*/
74
74
let autoProducts = [ swiftPMProduct, swiftPMDataModelProduct]
75
75
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
+
76
89
let package = Package (
77
90
name: " SwiftPM " ,
78
91
platforms: [
@@ -218,9 +231,8 @@ let package = Package(
218
231
name: " PackageModel " ,
219
232
dependencies: [ " Basics " ] ,
220
233
exclude: [ " CMakeLists.txt " , " README.md " ] ,
221
- resources: [
222
- . copy( " InstalledLibrariesSupport/provided-libraries.json " ) ,
223
- ]
234
+ resources: packageModelResources,
235
+ swiftSettings: packageModelResourcesSettings
224
236
) ,
225
237
226
238
. target(
Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ public final class UserToolchain: Toolchain {
545
545
if let customProvidedLibraries {
546
546
self . providedLibraries = customProvidedLibraries
547
547
} 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.
549
549
#if SKIP_RESOURCE_SUPPORT
550
550
let path = self . swiftCompilerPath. parentDirectory. parentDirectory. appending ( components: [ " share " , " pm " , " provided-libraries.json " ] )
551
551
#else
You can’t perform that action at this time.
0 commit comments