简体   繁体   English

iOS Xcode:使用32位/ 64位子项目构建32位项目

[英]iOS Xcode: building a 32-bit project with a 32-bit/64-bit subproject

I have a number of iOS Xcode projects that all use the same subproject. 我有多个iOS Xcode项目,它们都使用相同的子项目。 This subproject builds a static library, that's then linked to the master project. 该子项目将构建一个静态库,然后将其链接到主项目。 Up until now this subproject and all master projects have been 32-bit. 到目前为止,该子项目和所有主项目都是32位的。

I want to build a new project with 64-bit support, so have set the architecture to "armv7, armv7s, arm64". 我想构建一个支持64位的新项目,因此将体系结构设置为“ armv7,armv7s,arm64”。

Of course, I had to update the shared subproject to "armv7, armv7s, arm64" as well. 当然,我也必须将共享子项目也更新为“ armv7,armv7s,arm64”。

Everything builds fine. 一切都很好。

However, now when I build old 32-bit-only projects to run on 64-bit devices it fails, because Xcode builds a 64-bit non-fat version of the static library from the subproject, which it can't link to. 但是,现在,当我构建只能在32位设备上运行的旧的仅32位项目时,它失败了,因为Xcode从子项目构建了静态库的64位非胖版本,它无法链接到该子项目。

Is there a way to tell Xcode (linker flag?) to build and link to the 32-bit version of the subproject, because the master project is 32-bit? 因为主项目是32位,有没有办法告诉Xcode(链接器标志?)构建并链接到子项目的32位版本?

Thanks, 谢谢,

Russell. 罗素。

Answer was that I had "Build Active Architecture Only" set to Yes in the subproject by mistake, causing it to always build a thin library. 答案是我在子项目中将“仅构建活动体系结构”设置为“是”,导致它始终构建精简库。 Setting to no, builds a thick lib with all supported architectures, meaning it'll work with a parent 32-bit project! 设置为no,将使用所有受支持的体系结构构建一个胖的lib,这意味着它将与父级32位项目一起使用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM