In xcode 4, what's the difference between “other c flags” and “other c++ flags”?
-
07-12-2019 - |
Question
Also, does listing them directly across from the respective label set them for both debug and release?
Solution
The Xcode help provides fairly clear definitions:
Name: Other C Flags
Abstract: Space-separated list of additional flags to pass to the compiler for C and Objective-C files. Be sure to backslash-escape any arguments that contain spaces or special characters (e.g. path names that may contain spaces). Use this setting if Xcode does not already provide UI for a particular C or Objective-C compiler flag. [OTHER_CFLAGS]
Name: Other C++ Flags
Abstract: Space-separated list of additional flags to pass to the compiler for C++ and Objective-C++ files. Be sure to backslash-escape any arguments that contain spaces or special characters (e.g. path names that may contain spaces). Use this setting if Xcode does not already provide UI for a C++ or Objective-C++ compiler flag. [OTHER_CPLUSPLUSFLAGS]
So "Other C Flags" are passed to the compiler when compiling C and Obj-C source files. "Other C++ Flags" are passed to the compiler when compiling C++ and Obj-C++ source files.
To your second question: Yes. You can specify flags for debug or release or another configuration by hitting the disclosure triangle to the left of "Other C Flags" and then putting the desired flag on the line corresponding to the desired configuration.
OTHER TIPS
C flags are used when compiling C and Objective-C source files. C++ flags are used when compiling C++ and Objective-C++ source files. They're analogous to CFLAGS
and CXXFLAGS
in make
.
I'm afraid I don't know about debug vs. release builds, but I'd presume they'd be used in both cases. Certainly you can easily try it out.