开发者

How to detect XCode vs Makefile build

开发者 https://www.devze.com 2023-01-09 06:47 出处:网络
I\'ld like to autom开发者_运维百科atically 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 t

I'ld like to autom开发者_运维百科atically 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消