Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 22929009: Ninja on mac and win should also read CFLAGS/CXXFLAGS. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cflags/gyptest-cflags.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import hashlib 6 import hashlib
7 import multiprocessing 7 import multiprocessing
8 import os.path 8 import os.path
9 import re 9 import re
10 import signal 10 import signal
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 if not pdbpath: 799 if not pdbpath:
800 obj = 'obj' 800 obj = 'obj'
801 if self.toolset != 'target': 801 if self.toolset != 'target':
802 obj += '.' + self.toolset 802 obj += '.' + self.toolset
803 pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, 803 pdbpath = os.path.normpath(os.path.join(obj, self.base_dir,
804 self.name + '.pdb')) 804 self.name + '.pdb'))
805 self.WriteVariableList(ninja_file, 'pdbname', [pdbpath]) 805 self.WriteVariableList(ninja_file, 'pdbname', [pdbpath])
806 self.WriteVariableList(ninja_file, 'pchprefix', [self.name]) 806 self.WriteVariableList(ninja_file, 'pchprefix', [self.name])
807 else: 807 else:
808 cflags = config.get('cflags', []) 808 cflags = config.get('cflags', [])
809 cflags_c = config.get('cflags_c', [])
810 cflags_cc = config.get('cflags_cc', [])
809 811
810 cflags_c = [] 812 # Respect environment variables related to build, but target-specific
811 cflags_cc = [] 813 # flags can still override them.
812 814 if self.toolset == 'target':
813 # Respect environment variables related to build, but target-specific 815 cflags_c = (os.environ.get('CPPFLAGS', '').split() +
814 # flags can still override them. 816 os.environ.get('CFLAGS', '').split() + cflags_c)
815 if self.toolset == 'target': 817 cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
816 cflags_c = (os.environ.get('CPPFLAGS', '').split() + 818 os.environ.get('CXXFLAGS', '').split() + cflags_cc)
817 os.environ.get('CFLAGS', '').split())
818 cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
819 os.environ.get('CXXFLAGS', '').split())
820
821 cflags_c.extend(config.get('cflags_c', []))
822 cflags_cc.extend(config.get('cflags_cc', []))
823 819
824 defines = config.get('defines', []) + extra_defines 820 defines = config.get('defines', []) + extra_defines
825 self.WriteVariableList(ninja_file, 'defines', 821 self.WriteVariableList(ninja_file, 'defines',
826 [Define(d, self.flavor) for d in defines]) 822 [Define(d, self.flavor) for d in defines])
827 if self.flavor == 'win': 823 if self.flavor == 'win':
828 self.WriteVariableList(ninja_file, 'rcflags', 824 self.WriteVariableList(ninja_file, 'rcflags',
829 [QuoteShellArgument(self.ExpandSpecial(f), self.flavor) 825 [QuoteShellArgument(self.ExpandSpecial(f), self.flavor)
830 for f in self.msvs_settings.GetRcflags(config_name, 826 for f in self.msvs_settings.GetRcflags(config_name,
831 self.GypPathToNinja)]) 827 self.GypPathToNinja)])
832 828
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 arglists.append( 2043 arglists.append(
2048 (target_list, target_dicts, data, params, config_name)) 2044 (target_list, target_dicts, data, params, config_name))
2049 pool.map(CallGenerateOutputForConfig, arglists) 2045 pool.map(CallGenerateOutputForConfig, arglists)
2050 except KeyboardInterrupt, e: 2046 except KeyboardInterrupt, e:
2051 pool.terminate() 2047 pool.terminate()
2052 raise e 2048 raise e
2053 else: 2049 else:
2054 for config_name in config_names: 2050 for config_name in config_names:
2055 GenerateOutputForConfig(target_list, target_dicts, data, params, 2051 GenerateOutputForConfig(target_list, target_dicts, data, params,
2056 config_name) 2052 config_name)
OLDNEW
« no previous file with comments | « no previous file | test/cflags/gyptest-cflags.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698