Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 gyp | 6 import gyp |
| 7 import gyp.common | 7 import gyp.common |
| 8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
| 9 import gyp.MSVSVersion | 9 import gyp.MSVSVersion |
| 10 import gyp.system_test | 10 import gyp.system_test |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 config = spec['configurations'][config_name] | 338 config = spec['configurations'][config_name] |
| 339 self.target = Target(spec['type']) | 339 self.target = Target(spec['type']) |
| 340 | 340 |
| 341 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) | 341 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) |
| 342 self.xcode_settings = self.msvs_settings = None | 342 self.xcode_settings = self.msvs_settings = None |
| 343 if self.flavor == 'mac': | 343 if self.flavor == 'mac': |
| 344 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) | 344 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) |
| 345 if self.flavor == 'win': | 345 if self.flavor == 'win': |
| 346 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, | 346 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, |
| 347 generator_flags) | 347 generator_flags) |
| 348 # TODO(scottmg): x64 support. | 348 target_platform = self.msvs_settings.GetTargetPlatform(config_name) |
| 349 self.ninja.variable('arch', self.win_env['x86']) | 349 self.ninja.variable('arch', self.win_env[target_platform]) |
| 350 | 350 |
| 351 # Compute predepends for all rules. | 351 # Compute predepends for all rules. |
| 352 # actions_depends is the dependencies this target depends on before running | 352 # actions_depends is the dependencies this target depends on before running |
| 353 # any of its action/rule/copy steps. | 353 # any of its action/rule/copy steps. |
| 354 # compile_depends is the dependencies this target depends on before running | 354 # compile_depends is the dependencies this target depends on before running |
| 355 # any of its compile steps. | 355 # any of its compile steps. |
| 356 actions_depends = [] | 356 actions_depends = [] |
| 357 compile_depends = [] | 357 compile_depends = [] |
| 358 # TODO(evan): it is rather confusing which things are lists and which | 358 # TODO(evan): it is rather confusing which things are lists and which |
| 359 # are strings. Fix these. | 359 # are strings. Fix these. |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 743 cflags_objcc)) | 743 cflags_objcc)) |
| 744 self.ninja.newline() | 744 self.ninja.newline() |
| 745 outputs = [] | 745 outputs = [] |
| 746 for source in sources: | 746 for source in sources: |
| 747 filename, ext = os.path.splitext(source) | 747 filename, ext = os.path.splitext(source) |
| 748 ext = ext[1:] | 748 ext = ext[1:] |
| 749 obj_ext = self.obj_ext | 749 obj_ext = self.obj_ext |
| 750 if ext in ('cc', 'cpp', 'cxx'): | 750 if ext in ('cc', 'cpp', 'cxx'): |
| 751 command = 'cxx' | 751 command = 'cxx' |
| 752 elif ext == 'c' or (ext in ('s', 'S') and self.flavor != 'win'): | 752 elif ext == 'c' or (ext in ('s', 'S') and self.flavor != 'win'): |
| 753 # TODO(scottmg): .s files won't be handled by the Windows compiler. | |
| 754 # We could add support for .asm, though that's only supported on | |
| 755 # x86. Currently not used in Chromium in favor of other third-party | |
| 756 # assemblers. | |
| 757 command = 'cc' | 753 command = 'cc' |
| 754 elif (self.flavor == 'win' and ext == 'asm' and | |
| 755 self.msvs_settings.GetTargetPlatform(config_name) == 'Win32'): | |
| 756 # Asm files only get auto assembled for x86 (not x64). | |
|
scottmg
2012/06/27 23:08:11
Is that a TODO? Or does VS actually not run ml64 a
bradn
2012/06/28 01:37:51
Frighteningly it doesn't run it.
| |
| 757 command = 'asm' | |
| 758 obj_ext = '_asm.obj' | |
|
scottmg
2012/06/27 23:08:11
is there a reason to add _asm to the name?
bradn
2012/06/28 01:37:51
There's one instance in the code base in which the
| |
| 758 elif self.flavor == 'mac' and ext == 'm': | 759 elif self.flavor == 'mac' and ext == 'm': |
| 759 command = 'objc' | 760 command = 'objc' |
| 760 elif self.flavor == 'mac' and ext == 'mm': | 761 elif self.flavor == 'mac' and ext == 'mm': |
| 761 command = 'objcxx' | 762 command = 'objcxx' |
| 762 elif self.flavor == 'win' and ext == 'rc': | 763 elif self.flavor == 'win' and ext == 'rc': |
| 763 command = 'rc' | 764 command = 'rc' |
| 764 obj_ext = '.res' | 765 obj_ext = '.res' |
| 765 else: | 766 else: |
| 766 # Ignore unhandled extensions. | 767 # Ignore unhandled extensions. |
| 767 continue | 768 continue |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1259 flock = 'flock' | 1260 flock = 'flock' |
| 1260 if flavor == 'mac': | 1261 if flavor == 'mac': |
| 1261 flock = './gyp-mac-tool flock' | 1262 flock = './gyp-mac-tool flock' |
| 1262 master_ninja.variable('cc', os.environ.get('CC', cc)) | 1263 master_ninja.variable('cc', os.environ.get('CC', cc)) |
| 1263 master_ninja.variable('cxx', os.environ.get('CXX', cxx)) | 1264 master_ninja.variable('cxx', os.environ.get('CXX', cxx)) |
| 1264 if flavor == 'win': | 1265 if flavor == 'win': |
| 1265 master_ninja.variable('ld', 'link.exe') | 1266 master_ninja.variable('ld', 'link.exe') |
| 1266 master_ninja.variable('idl', 'midl.exe') | 1267 master_ninja.variable('idl', 'midl.exe') |
| 1267 master_ninja.variable('ar', 'lib.exe') | 1268 master_ninja.variable('ar', 'lib.exe') |
| 1268 master_ninja.variable('rc', 'rc.exe') | 1269 master_ninja.variable('rc', 'rc.exe') |
| 1270 master_ninja.variable('asm', 'ml.exe') | |
| 1269 else: | 1271 else: |
| 1270 master_ninja.variable('ld', flock + ' linker.lock $cxx') | 1272 master_ninja.variable('ld', flock + ' linker.lock $cxx') |
| 1271 master_ninja.variable('ar', os.environ.get('AR', 'ar')) | 1273 master_ninja.variable('ar', os.environ.get('AR', 'ar')) |
| 1272 | 1274 |
| 1273 master_ninja.variable('ar_target', os.environ.get('AR_target', '$ar')) | 1275 master_ninja.variable('ar_target', os.environ.get('AR_target', '$ar')) |
| 1274 master_ninja.variable('cc_target', os.environ.get('CC_target', '$cc')) | 1276 master_ninja.variable('cc_target', os.environ.get('CC_target', '$cc')) |
| 1275 master_ninja.variable('cxx_target', os.environ.get('CXX_target', '$cxx')) | 1277 master_ninja.variable('cxx_target', os.environ.get('CXX_target', '$cxx')) |
| 1276 if flavor == 'win': | 1278 if flavor == 'win': |
| 1277 master_ninja.variable('ld_target', os.environ.get('LD_target', '$ld')) | 1279 master_ninja.variable('ld_target', os.environ.get('LD_target', '$ld')) |
| 1278 else: | 1280 else: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1346 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' | 1348 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' |
| 1347 '$tlb $h $dlldata $iid $proxy $in ' | 1349 '$tlb $h $dlldata $iid $proxy $in ' |
| 1348 '$idlflags' % sys.executable)) | 1350 '$idlflags' % sys.executable)) |
| 1349 master_ninja.rule( | 1351 master_ninja.rule( |
| 1350 'rc', | 1352 'rc', |
| 1351 description='RC $in', | 1353 description='RC $in', |
| 1352 # Note: $in must be last otherwise rc.exe complains. | 1354 # Note: $in must be last otherwise rc.exe complains. |
| 1353 command=('%s gyp-win-tool rc-wrapper ' | 1355 command=('%s gyp-win-tool rc-wrapper ' |
| 1354 '$arch $rc $defines $includes $rcflags /fo$out $in' % | 1356 '$arch $rc $defines $includes $rcflags /fo$out $in' % |
| 1355 sys.executable)) | 1357 sys.executable)) |
| 1358 master_ninja.rule( | |
| 1359 'asm', | |
| 1360 description='ASM $in', | |
| 1361 command=('%s gyp-win-tool asm-wrapper ' | |
| 1362 '$arch $asm $defines $includes /c /Fo $out $in' % | |
| 1363 sys.executable)) | |
| 1356 | 1364 |
| 1357 if flavor != 'mac' and flavor != 'win': | 1365 if flavor != 'mac' and flavor != 'win': |
| 1358 master_ninja.rule( | 1366 master_ninja.rule( |
| 1359 'alink', | 1367 'alink', |
| 1360 description='AR $out', | 1368 description='AR $out', |
| 1361 command='rm -f $out && $ar rcsT $out $in') | 1369 command='rm -f $out && $ar rcsT $out $in') |
| 1362 master_ninja.rule( | 1370 master_ninja.rule( |
| 1363 'solink', | 1371 'solink', |
| 1364 description='SOLINK $out', | 1372 description='SOLINK $out', |
| 1365 command=('$ld -shared $ldflags -o $out -Wl,-soname=$soname ' | 1373 command=('$ld -shared $ldflags -o $out -Wl,-soname=$soname ' |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1545 | 1553 |
| 1546 user_config = params.get('generator_flags', {}).get('config', None) | 1554 user_config = params.get('generator_flags', {}).get('config', None) |
| 1547 if user_config: | 1555 if user_config: |
| 1548 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1556 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1549 user_config) | 1557 user_config) |
| 1550 else: | 1558 else: |
| 1551 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1559 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 1552 for config_name in config_names: | 1560 for config_name in config_names: |
| 1553 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1561 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1554 config_name) | 1562 config_name) |
| OLD | NEW |