Chromium Code Reviews| Index: pylib/gyp/generator/msvs.py |
| =================================================================== |
| --- pylib/gyp/generator/msvs.py (revision 836) |
| +++ pylib/gyp/generator/msvs.py (working copy) |
| @@ -4,12 +4,14 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +from copy import deepcopy |
| import ntpath |
| +import os |
| import posixpath |
| -import os |
| import re |
| import subprocess |
| import sys |
| +import uuid |
| import gyp.MSVSNew as MSVSNew |
| import gyp.MSVSProject as MSVSProject |
| @@ -1161,6 +1163,36 @@ |
| configs.add(_ConfigFullName(config_name, c)) |
| configs = list(configs) |
| + # MSVS has some "issues" with checking dependencies for the "Compile |
| + # sources" step with any source files/headers generated by actions/rules. |
| + # To work around this, if a target is building anything directly (not |
| + # type "none"), then a second target as used to run the GYP actions/rules |
| + # and is made a dependency of this target. This way the work is done |
| + # before the dependency checks for what should be recompiled. |
| + new_target_list = [] |
| + for qualified_target in target_list: |
| + spec = target_dicts[qualified_target] |
| + spec_actions = spec.get('actions', []) |
| + spec_rules = spec.get('rules', []) |
| + if spec['type'] != 'none' and (spec_actions or spec_rules): |
| + [build_file, target, toolset] = gyp.common.ParseQualifiedTarget( |
| + qualified_target) |
| + new_target = "%s:%s_prebuilt" % (build_file, target) |
| + if toolset: |
| + new_target += "#%s" % (toolset) |
| + target_dicts[new_target] = deepcopy(target_dicts[qualified_target]) |
|
M-A Ruel
2010/07/03 14:04:55
I'd like it to check if new_target in target_dicts
|
| + if spec.has_key('dependencies'): |
| + target_dicts[new_target]['dependencies'].append(new_target) |
| + else: |
| + target_dicts[new_target]['dependencies'] = [new_target] |
| + default_config = target_dicts[new_target]['configurations'][ |
| + target_dicts[new_target]['default_configuration']] |
| + default_config['msvs_guid'] = str(uuid.uuid4()).upper() |
| + new_target_list.append(new_target) |
| + new_target_list.append(qualified_target) |
| + |
| + target_list = new_target_list |
| + |
| # Generate each project. |
| projects = {} |
| for qualified_target in target_list: |