LLVM equivalent of gcc -D macro definition on commandline

shrm picture shrm · Mar 13, 2013 · Viewed 10.4k times · Source

I am looking for LLVM (or clang) equivalent of gcc's -D flag which enables macro definition at commandline.

Any pointers would be great.

Answer

Oliver Charlesworth picture Oliver Charlesworth · Mar 13, 2013

From clang --cc1 --help:

...
-D <macro>              Predefine the specified macro
...

As a rule of thumb, assume that Clang emulates GCC, unless proven otherwise!