0

The Problem

Every time I create a new project in Xcode I have to go to Project > Edit Project Settings and navigate to Treat Warnings as Errors and Run Static Analyzer to turn them on. For the life of me I cannot seem to find out how to make this the default from now on.

What I Have Tried

Hunting through the menus. Google. Stackoverflow.com. A animal sacrifice in a graveyard at midnight (OK, I haven't tried that yet, but after this it is next on my list).

The Question

Is there a simple way of setting compiler settings for new projects?

Please don't tell me to upgrade to Xcode 4. I already have it (and have not explored to see if I can accomplish this task in it yet). I still will need Xcode 3 for a few months.

Whoops! Almost forgot -- thanks in advance!

AWF4vk
  • 5,810
  • 3
  • 37
  • 70
idz
  • 12,825
  • 1
  • 29
  • 40

1 Answers1

2

The easiest way would be to simply create a custom project template that had those settings enabled. Create two new projects, change the settings in one - then do a diff on the project.pbxproj files for both to see how the settings occur in the project file.

Then find the existing project templates in:

/Developer/Library/Xcode/Project Templates

Copy them into the local custom project template directory in your local Library:

~/Library/Application Support/Developer/Shared/Xcode/Project Templates

(don't forget the space)

Then modify the project file in the project template to have the same changes you got out of the project diff before.

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
  • Thanks Kendall! I suspected that this would be the answer, but I was hoping for an easier way (you know like a setting somewhere that said make this the default!). I'll leave the question open for a while to see if someone knows any sneakier way. But since I suspect your way works I'll vote it up. – idz May 16 '11 at 09:18
  • If you really, really want to you could also simply change the project templates in place at the /Developer... location. Then you wouldn't have to select anything custom... but you'd lose those changes every time you updated XCode. With 3 on the way out though perhaps you'd not have many updates to re-apply changes to... – Kendall Helmstetter Gelner May 16 '11 at 09:34
  • Well looks like this is the way to go. Thank you for your time, I really appreciate it. – idz May 16 '11 at 09:59