Search code examples
c++cxcode4compiler-flags

In xcode 4, what's the difference between "other c flags" and "other c++ flags"?


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.