Xcode: Conditional Build Settings based on architecture (Device (ARM) vs Simulator (i386))

前端 未结 7 1603
陌清茗
陌清茗 2020-12-07 23:22

I\'m building an iPhone app that has to run on both the simulator and the device. However I\'m using an externally compiled library that has one version for the simulator an

相关标签:
7条回答
  • 2020-12-07 23:38

    You have 3 options:

    1. If you control click on the name of build setting inside the Inspect Window (where you can change compiler settings, etc) it will bring an option to conditionalize that setting. Just go to the linker flags you want to change, and conditionalize them by SDK, then enter the specific library for each SDK.

    2. Alternatively you can take the library and install it at the same path in each SDKs root ("/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/" and "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib"). Since SDK relative library search paths are used the appropriate version will be pulled in for either build.

    3. You can lipo together two libraries into one fat library. That is probably a bad idea, but if you want to do it checkout the manpage.

    0 讨论(0)
提交回复
热议问题