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

Unified Diff: pylib/gyp/generator/msvs.py

Issue 2876041: Create _prebuild projects for targets with rules/actions (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: don't mess with copies Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698