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

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

Issue 861273003: Reland "msvs/ninja win: Fix support for ImageHasSafeExceptionHandlers" (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Rebase Created 5 years, 10 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 | « pylib/gyp/generator/msvs.py ('k') | pylib/gyp/msvs_emulation.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 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
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
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).
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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 cc = GetEnvironFallback(['CC_target', 'CC'], cc) 1899 cc = GetEnvironFallback(['CC_target', 'CC'], cc)
1901 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) 1900 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc))
1902 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) 1901 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx)
1903 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) 1902 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx))
1904 1903
1905 if flavor == 'win': 1904 if flavor == 'win':
1906 master_ninja.variable('ld', ld) 1905 master_ninja.variable('ld', ld)
1907 master_ninja.variable('idl', 'midl.exe') 1906 master_ninja.variable('idl', 'midl.exe')
1908 master_ninja.variable('ar', ar) 1907 master_ninja.variable('ar', ar)
1909 master_ninja.variable('rc', 'rc.exe') 1908 master_ninja.variable('rc', 'rc.exe')
1910 master_ninja.variable('asm', 'ml.exe') 1909 master_ninja.variable('ml_x86', 'ml.exe')
1910 master_ninja.variable('ml_x64', 'ml64.exe')
1911 master_ninja.variable('mt', 'mt.exe') 1911 master_ninja.variable('mt', 'mt.exe')
1912 else: 1912 else:
1913 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) 1913 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld))
1914 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) 1914 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx))
1915 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) 1915 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar))
1916 if flavor != 'mac': 1916 if flavor != 'mac':
1917 # Mac does not use readelf/nm for .TOC generation, so avoiding polluting 1917 # Mac does not use readelf/nm for .TOC generation, so avoiding polluting
1918 # the master ninja with extra unused variables. 1918 # the master ninja with extra unused variables.
1919 master_ninja.variable( 1919 master_ninja.variable(
1920 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) 1920 'nm', GetEnvironFallback(['NM_target', 'NM'], nm))
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 arglists.append( 2381 arglists.append(
2382 (target_list, target_dicts, data, params, config_name)) 2382 (target_list, target_dicts, data, params, config_name))
2383 pool.map(CallGenerateOutputForConfig, arglists) 2383 pool.map(CallGenerateOutputForConfig, arglists)
2384 except KeyboardInterrupt, e: 2384 except KeyboardInterrupt, e:
2385 pool.terminate() 2385 pool.terminate()
2386 raise e 2386 raise e
2387 else: 2387 else:
2388 for config_name in config_names: 2388 for config_name in config_names:
2389 GenerateOutputForConfig(target_list, target_dicts, data, params, 2389 GenerateOutputForConfig(target_list, target_dicts, data, params,
2390 config_name) 2390 config_name)
OLDNEW
« no previous file with comments | « pylib/gyp/generator/msvs.py ('k') | pylib/gyp/msvs_emulation.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698