anyone know if its possible to set cflags/linker flags different for simulator vs device on the same build target in xcode.
anyone know if its possible to set cflags/linker flags different for simulator vs device
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In an .xcconfig file, you can have
Any build setting can be conditional on a number of things, for example the shortname for an sdk. The device SDKs are named iphoneos-4.0 for example, and sim iphonesimulator-4.0. The above thus gets you the ‘foobar’ as CFLAG for the device, and ‘barfoo’ for the sim.
To get started with xcconfigs quickly:
Notice how the build settings UI now lets you edit the conditionals… You can create new conditionals with the lower left button, but it won’t let you set “iphoneos*” for example, only specific versions.
Note that the magical $(inherited) lets you make a setting that inherits project settings but overrides just a part of it, like so:
I don’t know a good resource for xcconfigs, but this’ll get you started anyway: http://robnapier.net/blog/build-system-1-build-panel-360#more-360