Remove #if arch(arm) check in Swift Package Manager #1561
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I assume the
#if arch(arm) || arch(arm64)
is meant to prevent older Intel macs from using Metal, however checking this here doesn't really work. This check is executed on the machine compiling the package, and it is very likely that the machine compiling the package is not the machine that a compiled app will run on.Current Behaviour:
This is especially problematic for me as Xcode Cloud builds are currently done on Intel machines, so Metal will not be used in built apps.
This PR enables Metal no matter what the compiling architecture is. In the case of running a universal app on an Intel mac, there is still the issue that Metal will be enabled when it probably shouldn't be (maybe a runtime check should be added?), however I think it is much more likely that you will want Metal enabled when using SPM (all iOS devices are Apple Silicon, and more and more macs are Apple Silicon)