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

前端 未结 7 1645
陌清茗
陌清茗 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:37

    The recommended way to do this is to not add the library to your project and target, but instead to set the Other Linker Flags to include separate, direct references to the link library per configuration.

    For Debug:

      OTHER_LINKER_FLAGS = -l/Path/To/My/Debug/Library.dylib
    

    For Release

      OTHER_LINKER_FLAGS = -l/Path/To/My/Release/Library.dylib
    

    You can of course use references to other build settings to make these paths relative to something durable, or use a Source Tree to an external source tree.

提交回复
热议问题