开发者

Conditional compilation

开发者 https://www.devze.com 2022-12-13 02:56 出处:网络
How do I add conditional compilation to my make开发者_开发问答file: say if I have a #ifdef SAVE_DATA in a cpp (.cc) file.Usually something like

How do I add conditional compilation to my make开发者_开发问答file: say if I have a #ifdef SAVE_DATA in a cpp (.cc) file.


Usually something like CXXFLAGS+=-DSAVE_DATA


For gcc et al, you can use the -Dfoo flag to define foo:

g++ -DSAVE_DATA=1 -c foo.cpp

0

精彩评论

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