[cfe-dev] How to programatically define a symbol?

Yaakov Davis yaakov.davis at gmail.com
Sat Apr 7 11:45:44 PDT 2012


I'm not using the command line, but the lib through code. How do I achieve
the desired effect *programatically*?

On Sat, Apr 7, 2012 at 9:42 PM, Matthieu Monrocq <matthieu.monrocq at gmail.com
> wrote:

>
>
> Le 7 avril 2012 20:17, Yaakov Davis <yaakov.davis at gmail.com> a écrit :
>
>> I want to programatically define a symbol, e.g. FOO, such that the code
>> "#if defined(FOO)" will evaluate to true during pre-processing.
>> How do I that?
>>
>> I tried addMacroDef("FOO"), and other methods, but to no avail.
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
> Either:
>
> #define FOO
>
> in the code or
>
> -DFOO
>
> on the command line during the compilation (for gcc and clang at least)
>
> -- Matthieu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120407/36be568d/attachment.html>


More information about the cfe-dev mailing list