Swift Package is built as a universal binary in main project

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.

created

Dec '21
*

last reply

Apr '22

29 days later

Jon_Shier

Jan '22

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

NeoNachoBoris Buegling

Jan '22

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.

2 Replies

1

shahzadmajeed

Jan '22

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

2 months later

TorustThomas Roughton

1

Mar '22

NeoNacho:

Build settings of client projects generally don't apply to packages in any way.

For what it's worth, I've filed FB9915302 about this. It's a major workflow issue for apps which need to be built with optimisations to run well enough to be tested -- the compile times are very lengthy regardless and building for architectures you're not going to use only makes it worse.

I'll also add that per-target optimisation settings would be very useful -- it's often the case that I'm working on a particular package and want that to be built in debug mode, but still need other packages it depends on to be in release mode so the app is usable.

1

1 month later

shahzadmajeed

Apr '22

@Torust just curious if you heard back from Apple on this?

TorustThomas Roughton

Apr '22

Nothing at this stage.

相关推荐
欢迎来到祖安!15 分钟前
企业微信 iPad 协议私有化方案:毫秒级事件推送与高并发承载实践
ios·企业微信·ipad
疯狂打码的少年17 分钟前
【计算机网络】OSI/RM七层模型(层次结构、各层功能速览)
开发语言·笔记·计算机网络·php
小灰灰搞电子18 分钟前
Rust+Slint 实现ModbusRTU从机调试助手源码分享
开发语言·rust·modbusrtu
程序喵大人19 分钟前
【C++入门】值类别与表达式 - 03 引用绑定:为什么有些参数能接住临时对象
开发语言·c++·引用绑定
子非鱼a28 分钟前
【WEB】[RoarCTF 2019]Easy Java
java·开发语言
软件黑马王子33 分钟前
19.资源加载模块:主要作用和基本原理
开发语言·前端框架·c#
fengkai45451 小时前
七、华为云网络类 + 计算类云服务实验总结
开发语言·php
神明不懂浪漫1 小时前
【第四章】索引——B+树、回表,加快数据库的查找能力的利器
开发语言·数据结构·数据库·经验分享·笔记·b树
博、、1 小时前
全民健身解决方案系统源码实战指南:从架构设计到部署全流程解析
开发语言·需求分析
liuze4081 小时前
安装boss-zhipin-mcp(招聘)
开发语言·python