@@ -145,7 +145,8 @@ let libraryEvolutionCondition = envBoolValue("LIBRARY_EVOLUTION", default: build
145145let compatibilityTestCondition = envBoolValue ( " COMPATIBILITY_TEST " , default: false )
146146
147147let useLocalDeps = envBoolValue ( " USE_LOCAL_DEPS " )
148- let attributeGraphCondition = envBoolValue ( " ATTRIBUTEGRAPH " , default: buildForDarwinPlatform && !isSPIBuild)
148+ let computeCondition = envBoolValue ( " OPENATTRIBUTESHIMS_COMPUTE " , default: true )
149+ let attributeGraphCondition = envBoolValue ( " OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH " , default: buildForDarwinPlatform && !isSPIBuild)
149150
150151// MARK: - Shared Settings
151152
@@ -228,6 +229,15 @@ extension Target {
228229 swiftSettings. append ( . define( " OPENATTRIBUTEGRAPH_ATTRIBUTEGRAPH " ) )
229230 self . swiftSettings = swiftSettings
230231 }
232+
233+ func addComputeBinarySettings( ) {
234+ dependencies. append (
235+ " Compute " ,
236+ )
237+ var swiftSettings = swiftSettings ?? [ ]
238+ swiftSettings. append ( . define( " OPENATTRIBUTEGRAPH_COMPUTE " ) )
239+ self . swiftSettings = swiftSettings
240+ }
231241}
232242
233243extension [ Platform ] {
@@ -385,7 +395,25 @@ if buildForDarwinPlatform {
385395 package . targets. append ( openAttributeGraphCompatibilityTestsTarget)
386396}
387397
388- if attributeGraphCondition {
398+ if computeCondition {
399+ let computeBinary = envBoolValue ( " OPENATTRIBUTESHIMS_COMPUTE_BINARY " , default: true )
400+ if computeBinary {
401+ let computeVersion = envStringValue ( " OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION " , default: " 0.0.1 " )
402+ let computeURL = envStringValue ( " OPENATTRIBUTESHIMS_COMPUTE_BINARY_URL " , default: " https://github.com/Kyle-Ye/Compute/releases/download/ \( computeVersion) /Compute.xcframework.zip " )
403+ let computeChecksum = envStringValue ( " OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM " , default: " 95a256da2055d7c73184aeb9be088ba7019f7ea79b8a31e2dd930526c5ccbe8f " )
404+ package . targets. append (
405+ . binaryTarget(
406+ name: " Compute " ,
407+ url: computeURL,
408+ checksum: computeChecksum
409+ ) ,
410+ )
411+ openAttributeGraphShimsTarget. addComputeBinarySettings ( )
412+ } else {
413+ // TODO
414+ }
415+ package . platforms = [ . iOS( . v18) , . macOS( . v15) , . macCatalyst( . v18) , . tvOS( . v18) , . watchOS( . v10) , . visionOS( . v2) ]
416+ } else if attributeGraphCondition {
389417 let privateFrameworkRepo : Package . Dependency
390418 if useLocalDeps {
391419 privateFrameworkRepo = Package . Dependency. package ( path: " ../DarwinPrivateFrameworks " )
0 commit comments