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 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 Loading... |
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 | |
1425 # support: https://github.com/sgraham/ninja | |
1426 # Template for compile commands mostly shared between compiling files | 1424 # Template for compile commands mostly shared between compiling files |
1427 # and generating PCH. In the case of PCH, the "output" is specified by /Fp | 1425 # 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 | 1426 # rather than /Fo (for object files), but we still need to specify an /Fo |
1429 # when compiling PCH. | 1427 # when compiling PCH. |
1430 cc_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch ' | 1428 cc_template = ('ninja -t msvc -r . -o $out -e $arch ' |
1431 '--command ' | 1429 '-- ' |
1432 '$cc /nologo /showIncludes /FC ' | 1430 '$cc /nologo /showIncludes /FC ' |
1433 '@$out.rsp ' | 1431 '@$out.rsp ' |
1434 '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ') | 1432 '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ') |
1435 cxx_template = ('ninja-deplist-helper -r . -q -f cl -o $out.dl -e $arch ' | 1433 cxx_template = ('ninja -t msvc -r . -o $out -e $arch ' |
1436 '--command ' | 1434 '-- ' |
1437 '$cxx /nologo /showIncludes /FC ' | 1435 '$cxx /nologo /showIncludes /FC ' |
1438 '@$out.rsp ' | 1436 '@$out.rsp ' |
1439 '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ') | 1437 '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ') |
1440 master_ninja.rule( | 1438 master_ninja.rule( |
1441 'cc', | 1439 'cc', |
1442 description='CC $out', | 1440 description='CC $out', |
1443 command=cc_template % {'outspec': '/Fo$out'}, | 1441 command=cc_template % {'outspec': '/Fo$out'}, |
1444 depfile='$out.dl', | 1442 depfile='$out.d', |
1445 rspfile='$out.rsp', | 1443 rspfile='$out.rsp', |
1446 rspfile_content='$defines $includes $cflags $cflags_c') | 1444 rspfile_content='$defines $includes $cflags $cflags_c') |
1447 master_ninja.rule( | 1445 master_ninja.rule( |
1448 'cc_pch', | 1446 'cc_pch', |
1449 description='CC PCH $out', | 1447 description='CC PCH $out', |
1450 command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'}, | 1448 command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'}, |
1451 depfile='$out.dl', | 1449 depfile='$out.d', |
1452 rspfile='$out.rsp', | 1450 rspfile='$out.rsp', |
1453 rspfile_content='$defines $includes $cflags $cflags_c') | 1451 rspfile_content='$defines $includes $cflags $cflags_c') |
1454 master_ninja.rule( | 1452 master_ninja.rule( |
1455 'cxx', | 1453 'cxx', |
1456 description='CXX $out', | 1454 description='CXX $out', |
1457 command=cxx_template % {'outspec': '/Fo$out'}, | 1455 command=cxx_template % {'outspec': '/Fo$out'}, |
1458 depfile='$out.dl', | 1456 depfile='$out.d', |
1459 rspfile='$out.rsp', | 1457 rspfile='$out.rsp', |
1460 rspfile_content='$defines $includes $cflags $cflags_cc') | 1458 rspfile_content='$defines $includes $cflags $cflags_cc') |
1461 master_ninja.rule( | 1459 master_ninja.rule( |
1462 'cxx_pch', | 1460 'cxx_pch', |
1463 description='CXX PCH $out', | 1461 description='CXX PCH $out', |
1464 command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'}, | 1462 command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'}, |
1465 depfile='$out.dl', | 1463 depfile='$out.d', |
1466 rspfile='$out.rsp', | 1464 rspfile='$out.rsp', |
1467 rspfile_content='$defines $includes $cflags $cflags_cc') | 1465 rspfile_content='$defines $includes $cflags $cflags_cc') |
1468 master_ninja.rule( | 1466 master_ninja.rule( |
1469 'idl', | 1467 'idl', |
1470 description='IDL $in', | 1468 description='IDL $in', |
1471 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' | 1469 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' |
1472 '$tlb $h $dlldata $iid $proxy $in ' | 1470 '$tlb $h $dlldata $iid $proxy $in ' |
1473 '$idlflags' % sys.executable)) | 1471 '$idlflags' % sys.executable)) |
1474 master_ninja.rule( | 1472 master_ninja.rule( |
1475 'rc', | 1473 'rc', |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 | 1726 |
1729 user_config = params.get('generator_flags', {}).get('config', None) | 1727 user_config = params.get('generator_flags', {}).get('config', None) |
1730 if user_config: | 1728 if user_config: |
1731 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1729 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1732 user_config) | 1730 user_config) |
1733 else: | 1731 else: |
1734 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1732 config_names = target_dicts[target_list[0]]['configurations'].keys() |
1735 for config_name in config_names: | 1733 for config_name in config_names: |
1736 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1734 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1737 config_name) | 1735 config_name) |
OLD | NEW |