Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 collections | 5 import collections |
| 6 import copy | 6 import copy |
| 7 import hashlib | 7 import hashlib |
| 8 import json | 8 import json |
| 9 import multiprocessing | 9 import multiprocessing |
| 10 import os.path | 10 import os.path |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) | 389 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) |
| 390 if self.flavor == 'win': | 390 if self.flavor == 'win': |
| 391 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, | 391 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, |
| 392 generator_flags) | 392 generator_flags) |
| 393 arch = self.msvs_settings.GetArch(config_name) | 393 arch = self.msvs_settings.GetArch(config_name) |
| 394 self.ninja.variable('arch', self.win_env[arch]) | 394 self.ninja.variable('arch', self.win_env[arch]) |
| 395 self.ninja.variable('cc', '$cl_' + arch) | 395 self.ninja.variable('cc', '$cl_' + arch) |
| 396 self.ninja.variable('cxx', '$cl_' + arch) | 396 self.ninja.variable('cxx', '$cl_' + arch) |
| 397 self.ninja.variable('cc_host', '$cl_' + arch) | 397 self.ninja.variable('cc_host', '$cl_' + arch) |
| 398 self.ninja.variable('cxx_host', '$cl_' + arch) | 398 self.ninja.variable('cxx_host', '$cl_' + arch) |
| 399 self.ninja.variable('asm', '$ml_' + arch) | |
| 399 | 400 |
| 400 if self.flavor == 'mac': | 401 if self.flavor == 'mac': |
| 401 self.archs = self.xcode_settings.GetActiveArchs(config_name) | 402 self.archs = self.xcode_settings.GetActiveArchs(config_name) |
| 402 if len(self.archs) > 1: | 403 if len(self.archs) > 1: |
| 403 self.arch_subninjas = dict( | 404 self.arch_subninjas = dict( |
| 404 (arch, ninja_syntax.Writer( | 405 (arch, ninja_syntax.Writer( |
| 405 OpenOutput(os.path.join(self.toplevel_build, | 406 OpenOutput(os.path.join(self.toplevel_build, |
| 406 self._SubninjaNameForArch(arch)), | 407 self._SubninjaNameForArch(arch)), |
| 407 'w'))) | 408 'w'))) |
| 408 for arch in self.archs) | 409 for arch in self.archs) |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 980 ext = ext[1:] | 981 ext = ext[1:] |
| 981 obj_ext = self.obj_ext | 982 obj_ext = self.obj_ext |
| 982 if ext in ('cc', 'cpp', 'cxx'): | 983 if ext in ('cc', 'cpp', 'cxx'): |
| 983 command = 'cxx' | 984 command = 'cxx' |
| 984 self.uses_cpp = True | 985 self.uses_cpp = True |
| 985 elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): | 986 elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): |
| 986 command = 'cc' | 987 command = 'cc' |
| 987 elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. | 988 elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. |
| 988 command = 'cc_s' | 989 command = 'cc_s' |
| 989 elif (self.flavor == 'win' and ext == 'asm' and | 990 elif (self.flavor == 'win' and ext == 'asm' and |
| 990 self.msvs_settings.GetArch(config_name) == 'x86' and | |
| 991 not self.msvs_settings.HasExplicitAsmRules(spec)): | 991 not self.msvs_settings.HasExplicitAsmRules(spec)): |
| 992 # Asm files only get auto assembled for x86 (not x64). | |
|
scottmg
2015/01/21 22:42:43
I have the feeling this doesn't match VS now thoug
| |
| 993 command = 'asm' | 992 command = 'asm' |
| 994 # Add the _asm suffix as msvs is capable of handling .cc and | 993 # Add the _asm suffix as msvs is capable of handling .cc and |
| 995 # .asm files of the same name without collision. | 994 # .asm files of the same name without collision. |
| 996 obj_ext = '_asm.obj' | 995 obj_ext = '_asm.obj' |
| 997 elif self.flavor == 'mac' and ext == 'm': | 996 elif self.flavor == 'mac' and ext == 'm': |
| 998 command = 'objc' | 997 command = 'objc' |
| 999 elif self.flavor == 'mac' and ext == 'mm': | 998 elif self.flavor == 'mac' and ext == 'mm': |
| 1000 command = 'objcxx' | 999 command = 'objcxx' |
| 1001 self.uses_cpp = True | 1000 self.uses_cpp = True |
| 1002 elif self.flavor == 'win' and ext == 'rc': | 1001 elif self.flavor == 'win' and ext == 'rc': |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1899 cc = GetEnvironFallback(['CC_target', 'CC'], cc) | 1898 cc = GetEnvironFallback(['CC_target', 'CC'], cc) |
| 1900 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) | 1899 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) |
| 1901 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) | 1900 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) |
| 1902 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) | 1901 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) |
| 1903 | 1902 |
| 1904 if flavor == 'win': | 1903 if flavor == 'win': |
| 1905 master_ninja.variable('ld', ld) | 1904 master_ninja.variable('ld', ld) |
| 1906 master_ninja.variable('idl', 'midl.exe') | 1905 master_ninja.variable('idl', 'midl.exe') |
| 1907 master_ninja.variable('ar', ar) | 1906 master_ninja.variable('ar', ar) |
| 1908 master_ninja.variable('rc', 'rc.exe') | 1907 master_ninja.variable('rc', 'rc.exe') |
| 1909 master_ninja.variable('asm', 'ml.exe') | 1908 master_ninja.variable('ml_x86', 'ml.exe') |
| 1909 master_ninja.variable('ml_x64', 'ml64.exe') | |
| 1910 master_ninja.variable('mt', 'mt.exe') | 1910 master_ninja.variable('mt', 'mt.exe') |
| 1911 else: | 1911 else: |
| 1912 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) | 1912 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) |
| 1913 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) | 1913 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) |
| 1914 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) | 1914 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) |
| 1915 if flavor != 'mac': | 1915 if flavor != 'mac': |
| 1916 # Mac does not use readelf/nm for .TOC generation, so avoiding polluting | 1916 # Mac does not use readelf/nm for .TOC generation, so avoiding polluting |
| 1917 # the master ninja with extra unused variables. | 1917 # the master ninja with extra unused variables. |
| 1918 master_ninja.variable( | 1918 master_ninja.variable( |
| 1919 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) | 1919 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2380 arglists.append( | 2380 arglists.append( |
| 2381 (target_list, target_dicts, data, params, config_name)) | 2381 (target_list, target_dicts, data, params, config_name)) |
| 2382 pool.map(CallGenerateOutputForConfig, arglists) | 2382 pool.map(CallGenerateOutputForConfig, arglists) |
| 2383 except KeyboardInterrupt, e: | 2383 except KeyboardInterrupt, e: |
| 2384 pool.terminate() | 2384 pool.terminate() |
| 2385 raise e | 2385 raise e |
| 2386 else: | 2386 else: |
| 2387 for config_name in config_names: | 2387 for config_name in config_names: |
| 2388 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2388 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 2389 config_name) | 2389 config_name) |
| OLD | NEW |