Swift Package is built as a universal binary in main project

Hi,

Following line from Xcode build log shows that Xcode is building swift package dependencies as universal binaries

CreateUniversalBinary .../UIComponents.o normal arm64\ x86_64 (in target 'UIComponents' from project 'PlatformPackages')

Also confirmed with lipo

lipo -info UIComponents.o
Architectures in the fat file: UIComponents.o are: x86_64 arm64 

Is it possible to build swift package for active architecture only? Or for selected architectures based on configuration.

@xwu any idea how to get people attention to this question? Thank you for your help

AFAIK, Swift packages in Xcode are built for the active architecture in debug mode and universally in release mode and there's no way to control the behavior. You may try changing the setting in your project, but I don't believe Xcode's SPM integration passes that setting through.

1 Like

That is correct, packages behave like projects do by default here and there's no control over the build setting. Build settings of client projects generally don't apply to packages in any way.

Could swift package itself specify build settings in Package.swift?

Terms of Service

Privacy Policy

Cookie Policy