make ninja generator respect CFLAGS and other variables

326 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Jun 5, 2013, 6:12:22 PM6/5/13
to gyp-developer
gyp make generator used to respect environment variables like CFLAGS or LDFLAGS, but it seems that the ninja generator doesn't.

What would be the best way to make it take these variables into account?

I'm fine with a more explicit approach than just taking them from environment, but there should be some way that doesn't require patching files to pass various flags.

Paweł

Paweł Hajdan, Jr.

unread,
Jun 12, 2013, 11:47:41 PM6/12/13
to gyp-developer
Hey gyp developers, any insights about this one? It'd be really great to get some advice - I should be able to write a patch to implement it.

Paweł

Evan Martin

unread,
Jun 13, 2013, 11:56:10 AM6/13/13
to Paweł Hajdan, Jr., gyp-developer
I think the code is pretty simple, but beyond that your guess is as
good as anyone else's. :)

Searching for cflags in ninja.py has promising points you could edit, like this:
https://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/generator/ninja.py#755

There are probably concerns you have -- like do you want your cflags
to come at the beginning or end of the command line -- which means you
might need to instead pull $CFLAGS in to the end of the variable's
definition. You can see how the cflags variable is used in the
eventual command line here:
https://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/generator/ninja.py#1522



On Wed, Jun 12, 2013 at 8:47 PM, Paweł Hajdan, Jr.
<phajd...@chromium.org> wrote:
> Hey gyp developers, any insights about this one? It'd be really great to get
> some advice - I should be able to write a patch to implement it.
>
> Paweł
>
>
> On Wed, Jun 5, 2013 at 3:12 PM, Paweł Hajdan, Jr. <phajd...@chromium.org>
> wrote:
>>
>> gyp make generator used to respect environment variables like CFLAGS or
>> LDFLAGS, but it seems that the ninja generator doesn't.
>>
>> What would be the best way to make it take these variables into account?
>>
>> I'm fine with a more explicit approach than just taking them from
>> environment, but there should be some way that doesn't require patching
>> files to pass various flags.
>>
>> Paweł
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "gyp-developer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gyp-develope...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages