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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 rspfile=rspfile, rspfile_content=rspfile_content) | 1189 rspfile=rspfile, rspfile_content=rspfile_content) |
1190 self.ninja.newline() | 1190 self.ninja.newline() |
1191 | 1191 |
1192 return rule_name | 1192 return rule_name |
1193 | 1193 |
1194 | 1194 |
1195 def CalculateVariables(default_variables, params): | 1195 def CalculateVariables(default_variables, params): |
1196 """Calculate additional variables for use in the build (called by gyp).""" | 1196 """Calculate additional variables for use in the build (called by gyp).""" |
1197 global generator_additional_non_configuration_keys | 1197 global generator_additional_non_configuration_keys |
1198 global generator_additional_path_sections | 1198 global generator_additional_path_sections |
1199 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc')) | |
1200 flavor = gyp.common.GetFlavor(params) | 1199 flavor = gyp.common.GetFlavor(params) |
1201 if flavor == 'mac': | 1200 if flavor == 'mac': |
1202 default_variables.setdefault('OS', 'mac') | 1201 default_variables.setdefault('OS', 'mac') |
1203 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') | 1202 default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') |
1204 default_variables.setdefault('SHARED_LIB_DIR', | 1203 default_variables.setdefault('SHARED_LIB_DIR', |
1205 generator_default_variables['PRODUCT_DIR']) | 1204 generator_default_variables['PRODUCT_DIR']) |
1206 default_variables.setdefault('LIB_DIR', | 1205 default_variables.setdefault('LIB_DIR', |
1207 generator_default_variables['PRODUCT_DIR']) | 1206 generator_default_variables['PRODUCT_DIR']) |
1208 | 1207 |
1209 # Copy additional generator configuration data from Xcode, which is shared | 1208 # Copy additional generator configuration data from Xcode, which is shared |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 master_ninja.rule('solink', description=dlldesc, command=dllcmd, | 1467 master_ninja.rule('solink', description=dlldesc, command=dllcmd, |
1469 rspfile='$dll.rsp', | 1468 rspfile='$dll.rsp', |
1470 rspfile_content='$libs $in_newline $ldflags', | 1469 rspfile_content='$libs $in_newline $ldflags', |
1471 restat=True) | 1470 restat=True) |
1472 master_ninja.rule('solink_module', description=dlldesc, command=dllcmd, | 1471 master_ninja.rule('solink_module', description=dlldesc, command=dllcmd, |
1473 rspfile='$dll.rsp', | 1472 rspfile='$dll.rsp', |
1474 rspfile_content='$libs $in_newline $ldflags', | 1473 rspfile_content='$libs $in_newline $ldflags', |
1475 restat=True) | 1474 restat=True) |
1476 # Note that ldflags goes at the end so that it has the option of | 1475 # Note that ldflags goes at the end so that it has the option of |
1477 # overriding default settings earlier in the command line. | 1476 # overriding default settings earlier in the command line. |
| 1477 command = ('%s gyp-win-tool link-wrapper $arch ' |
| 1478 '$ld /nologo /OUT:$out /PDB:$out.pdb @$out.rsp' % |
| 1479 sys.executable) |
| 1480 if not os.environ.get('LD_target'): |
| 1481 command += (' && %s gyp-win-tool manifest-wrapper $arch ' |
| 1482 '$mt -nologo -manifest $manifests -out:$out.manifest' % |
| 1483 sys.executable) |
1478 master_ninja.rule( | 1484 master_ninja.rule( |
1479 'link', | 1485 'link', |
1480 description='LINK $out', | 1486 description='LINK $out', |
1481 command=('%s gyp-win-tool link-wrapper $arch ' | 1487 command=command, |
1482 '$ld /nologo /OUT:$out /PDB:$out.pdb @$out.rsp && ' | |
1483 '%s gyp-win-tool manifest-wrapper $arch ' | |
1484 '$mt -nologo -manifest $manifests -out:$out.manifest' % | |
1485 (sys.executable, sys.executable)), | |
1486 rspfile='$out.rsp', | 1488 rspfile='$out.rsp', |
1487 rspfile_content='$in_newline $libs $ldflags') | 1489 rspfile_content='$in_newline $libs $ldflags') |
1488 else: | 1490 else: |
1489 master_ninja.rule( | 1491 master_ninja.rule( |
1490 'objc', | 1492 'objc', |
1491 description='OBJC $out', | 1493 description='OBJC $out', |
1492 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' | 1494 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' |
1493 '$cflags_pch_objc -c $in -o $out'), | 1495 '$cflags_pch_objc -c $in -o $out'), |
1494 depfile='$out.d') | 1496 depfile='$out.d') |
1495 master_ninja.rule( | 1497 master_ninja.rule( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 | 1651 |
1650 user_config = params.get('generator_flags', {}).get('config', None) | 1652 user_config = params.get('generator_flags', {}).get('config', None) |
1651 if user_config: | 1653 if user_config: |
1652 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1654 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1653 user_config) | 1655 user_config) |
1654 else: | 1656 else: |
1655 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1657 config_names = target_dicts[target_list[0]]['configurations'].keys() |
1656 for config_name in config_names: | 1658 for config_name in config_names: |
1657 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1659 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1658 config_name) | 1660 config_name) |
OLD | NEW |