Using CFLAGS, LDFLAGS from the environment

2,256 views
Skip to first unread message

phajd...@chromium.org

unread,
May 28, 2013, 1:38:10 PM5/28/13
to ninja...@googlegroups.com
How to make ninja use CFLAGS, CXXFLAGS, LDFLAGS and so on from the environment?


My understanding is that this should be handled at ninja build files generation time, not during actual build. Still, either I'm missing something or the ninja gyp generator behaves differently from the make build generator...

Paweł

Evan Martin

unread,
May 29, 2013, 12:44:54 AM5/29/13
to Paweł Hajdan, Jr., ninja-build
Ninja is mostly ignorant of compiling and linking etc, it just runs commands.  So I think if the issue is that gyp doesn't respect CFLAGS etc., then it's a bug in gyp's ninja.py.

It looks like that obeys CC from the environment but has no support for command-line changes to the flags passed to various commands.
You might be able to hack it with something like "CC=gcc -funroll-loops" if you didn't want to modify any code.  I also wonder if there are any flags that make sense for Chromium it might make more sense to just put them in the gyp files directly.  But there's always adding it to gyp too.  You might need to make your flags come last if they conflict with Chromium's flags.


Paweł

--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages