LLVM compiler settings, clarification needed

Are compiler settings set per project or once and for all?

For example, can one declare:

For all projects i create from this day forth, until told otherwise, treat all warnings as errors

Answers


If you're using Xcode*, just use shared/global xcconfig files. Definitions at the project and target levels have precedence if defined, so you can make exceptions and/or combine them in many ways.

Xcconfig Crash Course:

This Q+A will explain the configuration.

Then you just fill the xcconfig file with the build settings you want, like so:

ADDITIONAL_SDKS = 
ARCHS = x86_64
SDKROOT = macosx10.7
ONLY_ACTIVE_ARCH = NO
SUPPORTED_PLATFORMS = macosx
VALID_ARCHS = i386 ppc ppc64 ppc7400 ppc970 x86_64

Other notes:

  • You can #include xcconfig files in xcconfig files (with some restrictions)
  • You can drag+drop build settings from Xcode's build settings view to a text file.

So, if all you want is "Treat warnings as errors", your xcconfig would have this:

GCC_TREAT_WARNINGS_AS_ERRORS = YES

Need Your Help

Why are copy constructors unnecessary for immutable objects?

language-agnostic copy immutability copy-constructor

Why are copy constructors unnecessary for immutable objects? Please explain this for me.