Reputation: 4569
Is there any best recommended way for setting up xcconfig files? Where does the projects related fields go and where do target related go? What about multiple targets?
Upvotes: 4
Views: 3107
Reputation: 21599
You might want to take a look at the Google Toolbox for Mac xcconfig files (look in the three subdirectories) for inspiration. They've been designed to be modular and re-usable across projects, and are broken down by project- and target-level settings.
Upvotes: 3
Reputation: 1826
I tend to take my XCConfigs and start with ProjBase, ProjDebug, ProjRel with the latter 2 including the former.
Granted I also use a barebones version.xcconfig for build versioning.
Target fields I find are usually best for the target particulars. (Redundant, I know) Basically, if you are dealing with App Bundle things or Lib signatures, they are best kept in the target. Target settings are more helpful when you are building your code, and a framework, and a library, and a unit test, etc. Then the target settings can do the necessary overrides you need from the project settings.
XCode 4 makes visualising this far easier.
Personally, I prefer to pull ALL build settings out of the project and into xcconfigs because then the project suffers less direct changes as you tweak these settings.
And when you are keeping your project in SCM Not having to have your team constantly update the pbxproj can be a godsend.
Best of luck.
Upvotes: 2