I'ld like to automatically detect (using #ifdef) whether I'm building using XCode or using make under Darwin. Is there a specific define to XCode or make set automatically by either tool? I'ld like to avoid setting a define in the XCode project or Makefile manually.
+1
A:
If you look in the XCode 'build results' window, and expand one of the "compile MyFile.m" lines (select the line, then click on the "lines of text" icon at the far right), you can see the exact command XCode is using to invoke gcc, including any "-D" options on the command line.
I don't believe make
is adding any -D defines automatically.
David Gelhar
2010-07-27 18:09:24
There are no -D defines in the command line, except some set by me. Neither does make add defines, as you said. So it seems I have to do this manually, which is not what I wanted.
eile
2010-07-28 06:37:23