Index: pylib/gyp/generator/ninja.py |
=================================================================== |
--- pylib/gyp/generator/ninja.py (revision 1651) |
+++ pylib/gyp/generator/ninja.py (working copy) |
@@ -753,9 +753,14 @@ |
self.WriteVariableList('pchprefix', [self.name]) |
else: |
cflags = config.get('cflags', []) |
- cflags_c = config.get('cflags_c', []) |
- cflags_cc = config.get('cflags_cc', []) |
+ # Respect environment variables related to build, but target-specific |
+ # flags can still override them. |
+ cflags_c = (os.environ.get('CFLAGS', '').split() + |
+ config.get('cflags_c', [])) |
+ cflags_cc = (os.environ.get('CXXFLAGS', '').split() + |
+ config.get('cflags_cc', [])) |
Nico
2013/06/25 00:42:35
Does it make sense to also check CPPFLAGS and add
Paweł Hajdan Jr.
2013/07/24 23:16:55
Done.
|
+ |
defines = config.get('defines', []) + extra_defines |
self.WriteVariableList('defines', [Define(d, self.flavor) for d in defines]) |
if self.flavor == 'win': |
@@ -925,7 +930,10 @@ |
self.GypPathToNinja, self.ExpandSpecial, manifest_name, is_executable) |
self.WriteVariableList('manifests', manifest_files) |
else: |
- ldflags = config.get('ldflags', []) |
+ # Respect environment variables related to build, but target-specific |
+ # flags can still override them. |
+ ldflags = (os.environ.get('LDFLAGS', '').split() + |
+ config.get('ldflags', [])) |
if is_executable and len(solibs): |
rpath = 'lib/' |
if self.toolset != 'target': |