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

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

Issue 10907263: Make gyp/win32 compatible with upstream ninja. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 3 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 | pylib/gyp/win_tool.py » ('j') | pylib/gyp/win_tool.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 hashlib 6 import hashlib
7 import os.path 7 import os.path
8 import re 8 import re
9 import subprocess 9 import subprocess
10 import sys 10 import sys
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c ' 1414 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c '
1415 '$cflags_pch_c -c $in -o $out'), 1415 '$cflags_pch_c -c $in -o $out'),
1416 depfile='$out.d') 1416 depfile='$out.d')
1417 master_ninja.rule( 1417 master_ninja.rule(
1418 'cxx', 1418 'cxx',
1419 description='CXX $out', 1419 description='CXX $out',
1420 command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc ' 1420 command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc '
1421 '$cflags_pch_cc -c $in -o $out'), 1421 '$cflags_pch_cc -c $in -o $out'),
1422 depfile='$out.d') 1422 depfile='$out.d')
1423 else: 1423 else:
1424 # TODO(scottmg): Requires fork of ninja for dependency and linking 1424 cc_template = ('ninja -t msvc -r . -o $out -e $arch '
1425 # support: https://github.com/sgraham/ninja 1425 '-- '
1426 # Template for compile commands mostly shared between compiling files
scottmg 2012/09/17 19:27:59 with the rest of this restored, lgtm
1427 # and generating PCH. In the case of PCH, the "output" is specified by /Fp
1428 # rather than /Fo (for object files), but we still need to specify an /Fo
1429 # when compiling PCH.
1430 cc_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch '
1431 '--command '
1432 '$cc /nologo /showIncludes /FC ' 1426 '$cc /nologo /showIncludes /FC '
1433 '@$out.rsp ' 1427 '@$out.rsp '
1434 '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ') 1428 '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ')
1435 cxx_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch ' 1429 cxx_template = ('ninja -t msvc -r . -o $out -e $arch '
1436 '--command ' 1430 '-- '
1437 '$cxx /nologo /showIncludes /FC ' 1431 '$cxx /nologo /showIncludes /FC '
1438 '@$out.rsp ' 1432 '@$out.rsp '
1439 '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ') 1433 '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ')
1440 master_ninja.rule( 1434 master_ninja.rule(
1441 'cc', 1435 'cc',
1442 description='CC $out', 1436 description='CC $out',
1443 command=cc_template % {'outspec': '/Fo$out'}, 1437 command=cc_template % {'outspec': '/Fo$out'},
1444 depfile='$out.dl', 1438 depfile='$out.d',
1445 rspfile='$out.rsp', 1439 rspfile='$out.rsp',
1446 rspfile_content='$defines $includes $cflags $cflags_c') 1440 rspfile_content='$defines $includes $cflags $cflags_c')
1447 master_ninja.rule( 1441 master_ninja.rule(
1448 'cc_pch', 1442 'cc_pch',
1449 description='CC PCH $out', 1443 description='CC PCH $out',
1450 command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'}, 1444 command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'},
1451 depfile='$out.dl', 1445 depfile='$out.d',
1452 rspfile='$out.rsp', 1446 rspfile='$out.rsp',
1453 rspfile_content='$defines $includes $cflags $cflags_c') 1447 rspfile_content='$defines $includes $cflags $cflags_c')
1454 master_ninja.rule( 1448 master_ninja.rule(
1455 'cxx', 1449 'cxx',
1456 description='CXX $out', 1450 description='CXX $out',
1457 command=cxx_template % {'outspec': '/Fo$out'}, 1451 command=cxx_template % {'outspec': '/Fo$out'},
1458 depfile='$out.dl', 1452 depfile='$out.d',
1459 rspfile='$out.rsp', 1453 rspfile='$out.rsp',
1460 rspfile_content='$defines $includes $cflags $cflags_cc') 1454 rspfile_content='$defines $includes $cflags $cflags_cc')
1461 master_ninja.rule( 1455 master_ninja.rule(
1462 'cxx_pch', 1456 'cxx_pch',
1463 description='CXX PCH $out', 1457 description='CXX PCH $out',
1464 command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'}, 1458 command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'},
1465 depfile='$out.dl', 1459 depfile='$out.d',
1466 rspfile='$out.rsp', 1460 rspfile='$out.rsp',
1467 rspfile_content='$defines $includes $cflags $cflags_cc') 1461 rspfile_content='$defines $includes $cflags $cflags_cc')
1468 master_ninja.rule( 1462 master_ninja.rule(
1469 'idl', 1463 'idl',
1470 description='IDL $in', 1464 description='IDL $in',
1471 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' 1465 command=('%s gyp-win-tool midl-wrapper $arch $outdir '
1472 '$tlb $h $dlldata $iid $proxy $in ' 1466 '$tlb $h $dlldata $iid $proxy $in '
1473 '$idlflags' % sys.executable)) 1467 '$idlflags' % sys.executable))
1474 master_ninja.rule( 1468 master_ninja.rule(
1475 'rc', 1469 'rc',
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 1722
1729 user_config = params.get('generator_flags', {}).get('config', None) 1723 user_config = params.get('generator_flags', {}).get('config', None)
1730 if user_config: 1724 if user_config:
1731 GenerateOutputForConfig(target_list, target_dicts, data, params, 1725 GenerateOutputForConfig(target_list, target_dicts, data, params,
1732 user_config) 1726 user_config)
1733 else: 1727 else:
1734 config_names = target_dicts[target_list[0]]['configurations'].keys() 1728 config_names = target_dicts[target_list[0]]['configurations'].keys()
1735 for config_name in config_names: 1729 for config_name in config_names:
1736 GenerateOutputForConfig(target_list, target_dicts, data, params, 1730 GenerateOutputForConfig(target_list, target_dicts, data, params,
1737 config_name) 1731 config_name)
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/win_tool.py » ('j') | pylib/gyp/win_tool.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698