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

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

Issue 17359002: Linux: make ninja respect environment: (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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 | no next file » | 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if not pdbpath: 746 if not pdbpath:
747 obj = 'obj' 747 obj = 'obj'
748 if self.toolset != 'target': 748 if self.toolset != 'target':
749 obj += '.' + self.toolset 749 obj += '.' + self.toolset
750 pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, 750 pdbpath = os.path.normpath(os.path.join(obj, self.base_dir,
751 self.name + '.pdb')) 751 self.name + '.pdb'))
752 self.WriteVariableList('pdbname', [pdbpath]) 752 self.WriteVariableList('pdbname', [pdbpath])
753 self.WriteVariableList('pchprefix', [self.name]) 753 self.WriteVariableList('pchprefix', [self.name])
754 else: 754 else:
755 cflags = config.get('cflags', []) 755 cflags = config.get('cflags', [])
756 cflags_c = config.get('cflags_c', []) 756
757 cflags_cc = config.get('cflags_cc', []) 757 # Respect environment variables related to build, but target-specific
758 # flags can still override them.
759 cflags_c = (os.environ.get('CFLAGS', '').split() +
760 config.get('cflags_c', []))
761 cflags_cc = (os.environ.get('CXXFLAGS', '').split() +
762 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.
758 763
759 defines = config.get('defines', []) + extra_defines 764 defines = config.get('defines', []) + extra_defines
760 self.WriteVariableList('defines', [Define(d, self.flavor) for d in defines]) 765 self.WriteVariableList('defines', [Define(d, self.flavor) for d in defines])
761 if self.flavor == 'win': 766 if self.flavor == 'win':
762 self.WriteVariableList('rcflags', 767 self.WriteVariableList('rcflags',
763 [QuoteShellArgument(self.ExpandSpecial(f), self.flavor) 768 [QuoteShellArgument(self.ExpandSpecial(f), self.flavor)
764 for f in self.msvs_settings.GetRcflags(config_name, 769 for f in self.msvs_settings.GetRcflags(config_name,
765 self.GypPathToNinja)]) 770 self.GypPathToNinja)])
766 771
767 include_dirs = config.get('include_dirs', []) 772 include_dirs = config.get('include_dirs', [])
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 ldflags = self.xcode_settings.GetLdflags(config_name, 923 ldflags = self.xcode_settings.GetLdflags(config_name,
919 self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), 924 self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']),
920 self.GypPathToNinja) 925 self.GypPathToNinja)
921 elif self.flavor == 'win': 926 elif self.flavor == 'win':
922 manifest_name = self.GypPathToUniqueOutput( 927 manifest_name = self.GypPathToUniqueOutput(
923 self.ComputeOutputFileName(spec)) 928 self.ComputeOutputFileName(spec))
924 ldflags, manifest_files = self.msvs_settings.GetLdflags(config_name, 929 ldflags, manifest_files = self.msvs_settings.GetLdflags(config_name,
925 self.GypPathToNinja, self.ExpandSpecial, manifest_name, is_executable) 930 self.GypPathToNinja, self.ExpandSpecial, manifest_name, is_executable)
926 self.WriteVariableList('manifests', manifest_files) 931 self.WriteVariableList('manifests', manifest_files)
927 else: 932 else:
928 ldflags = config.get('ldflags', []) 933 # Respect environment variables related to build, but target-specific
934 # flags can still override them.
935 ldflags = (os.environ.get('LDFLAGS', '').split() +
936 config.get('ldflags', []))
929 if is_executable and len(solibs): 937 if is_executable and len(solibs):
930 rpath = 'lib/' 938 rpath = 'lib/'
931 if self.toolset != 'target': 939 if self.toolset != 'target':
932 rpath += self.toolset 940 rpath += self.toolset
933 ldflags.append('-Wl,-rpath=\$$ORIGIN/%s' % rpath) 941 ldflags.append('-Wl,-rpath=\$$ORIGIN/%s' % rpath)
934 ldflags.append('-Wl,-rpath-link=%s' % rpath) 942 ldflags.append('-Wl,-rpath-link=%s' % rpath)
935 self.WriteVariableList('ldflags', 943 self.WriteVariableList('ldflags',
936 gyp.common.uniquer(map(self.ExpandSpecial, 944 gyp.common.uniquer(map(self.ExpandSpecial,
937 ldflags))) 945 ldflags)))
938 946
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 arglists.append( 1879 arglists.append(
1872 (target_list, target_dicts, data, params, config_name)) 1880 (target_list, target_dicts, data, params, config_name))
1873 pool.map(CallGenerateOutputForConfig, arglists) 1881 pool.map(CallGenerateOutputForConfig, arglists)
1874 except KeyboardInterrupt, e: 1882 except KeyboardInterrupt, e:
1875 pool.terminate() 1883 pool.terminate()
1876 raise e 1884 raise e
1877 else: 1885 else:
1878 for config_name in config_names: 1886 for config_name in config_names:
1879 GenerateOutputForConfig(target_list, target_dicts, data, params, 1887 GenerateOutputForConfig(target_list, target_dicts, data, params,
1880 config_name) 1888 config_name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698