How to change Xcode build setup without modifying project files?

邮差的信 提交于 2019-12-03 10:20:52

问题


I would like to know if it is possible to change compile settings without modifying the xcode projects.

Example, adding -Wno-unused-parameter to CFLAGS in such way that it will be used by Xcode when building projects.

This has to work in both case: build made from xcode in GUI or from the console.

If someone asks about why, let's say that the number of projects is quite big and that you may want to alter the options only temporary.


回答1:


Put the compiler settings you want to change in a configuration settings file. You can create a new one by choosing File > New > New File. The configuration settings file is in the Other group under both iOS and Mac OS X.

To tell an Xcode project to use the configuration settings file, select the project file from the project navigator to open the project editor. Select the project from the left side of the editor. Click the Info button at the top of the editor. You should see a list of build configurations in the editor. Click the disclosure triangle next to a build configuration to have it use a configuration settings file.



来源:https://stackoverflow.com/questions/6791297/how-to-change-xcode-build-setup-without-modifying-project-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!