How to define C++ preprocessor variable in Makefile

前端 未结 5 1173
Happy的楠姐
Happy的楠姐 2020-12-13 17:22

I have a C++ preprocessor written like this:

  #ifdef cpp_variable
   //x+y;
  #endif

Can anyone tell me how to define this in Makefile.

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 18:14

    This is compiler specific.

    GCC uses -Dcpp_variable=VALUE or just -Dcpp_variable

    Microsoft's compilers use /D

提交回复
热议问题