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

Side by Side Diff: pylib/gyp/input.py

Issue 12063003: Added new command line option: --allow-duplicate-basenames (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 11 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 | « pylib/gyp/__init__.py ('k') | no next file » | no next file with comments »
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 from compiler.ast import Const 5 from compiler.ast import Const
6 from compiler.ast import Dict 6 from compiler.ast import Dict
7 from compiler.ast import Discard 7 from compiler.ast import Discard
8 from compiler.ast import List 8 from compiler.ast import List
9 from compiler.ast import Module 9 from compiler.ast import Module
10 from compiler.ast import Node 10 from compiler.ast import Node
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 # Prepare a key like 'path/to:target_name'. 2510 # Prepare a key like 'path/to:target_name'.
2511 key = subdir + ':' + name 2511 key = subdir + ':' + name
2512 if key in used: 2512 if key in used:
2513 # Complain if this target is already used. 2513 # Complain if this target is already used.
2514 raise GypError('Duplicate target name "%s" in directory "%s" used both ' 2514 raise GypError('Duplicate target name "%s" in directory "%s" used both '
2515 'in "%s" and "%s".' % (name, subdir, gyp, used[key])) 2515 'in "%s" and "%s".' % (name, subdir, gyp, used[key]))
2516 used[key] = gyp 2516 used[key] = gyp
2517 2517
2518 2518
2519 def Load(build_files, variables, includes, depth, generator_input_info, check, 2519 def Load(build_files, variables, includes, depth, generator_input_info, check,
2520 circular_check, parallel): 2520 circular_check, allow_duplicates, parallel):
2521 # Set up path_sections and non_configuration_keys with the default data plus 2521 # Set up path_sections and non_configuration_keys with the default data plus
2522 # the generator-specifc data. 2522 # the generator-specifc data.
2523 global path_sections 2523 global path_sections
2524 path_sections = base_path_sections[:] 2524 path_sections = base_path_sections[:]
2525 path_sections.extend(generator_input_info['path_sections']) 2525 path_sections.extend(generator_input_info['path_sections'])
2526 2526
2527 global non_configuration_keys 2527 global non_configuration_keys
2528 non_configuration_keys = base_non_configuration_keys[:] 2528 non_configuration_keys = base_non_configuration_keys[:]
2529 non_configuration_keys.extend(generator_input_info['non_configuration_keys']) 2529 non_configuration_keys.extend(generator_input_info['non_configuration_keys'])
2530 2530
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 target_dict, PHASE_LATELATE, variables, build_file) 2650 target_dict, PHASE_LATELATE, variables, build_file)
2651 2651
2652 # Make sure that the rules make sense, and build up rule_sources lists as 2652 # Make sure that the rules make sense, and build up rule_sources lists as
2653 # needed. Not all generators will need to use the rule_sources lists, but 2653 # needed. Not all generators will need to use the rule_sources lists, but
2654 # some may, and it seems best to build the list in a common spot. 2654 # some may, and it seems best to build the list in a common spot.
2655 # Also validate actions and run_as elements in targets. 2655 # Also validate actions and run_as elements in targets.
2656 for target in flat_list: 2656 for target in flat_list:
2657 target_dict = targets[target] 2657 target_dict = targets[target]
2658 build_file = gyp.common.BuildFile(target) 2658 build_file = gyp.common.BuildFile(target)
2659 ValidateTargetType(target, target_dict) 2659 ValidateTargetType(target, target_dict)
2660 # TODO(thakis): Get vpx_scale/arm/scalesystemdependent.c to be renamed to 2660 if not allow_duplicates:
2661 # scalesystemdependent_arm_additions.c or similar. 2661 # TODO(thakis): Get vpx_scale/arm/scalesystemdependent.c to be renamed to
2662 if 'arm' not in variables.get('target_arch', ''): 2662 # scalesystemdependent_arm_additions.c or similar.
2663 ValidateSourcesInTarget(target, target_dict, build_file) 2663 if 'arm' not in variables.get('target_arch', ''):
Sam Clegg 2013/01/29 18:55:15 Could we have some gyp variable / define that we c
2664 ValidateSourcesInTarget(target, target_dict, build_file)
2664 ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) 2665 ValidateRulesInTarget(target, target_dict, extra_sources_for_rules)
2665 ValidateRunAsInTarget(target, target_dict, build_file) 2666 ValidateRunAsInTarget(target, target_dict, build_file)
2666 ValidateActionsInTarget(target, target_dict, build_file) 2667 ValidateActionsInTarget(target, target_dict, build_file)
2667 2668
2668 # Generators might not expect ints. Turn them into strs. 2669 # Generators might not expect ints. Turn them into strs.
2669 TurnIntIntoStrInDict(data) 2670 TurnIntIntoStrInDict(data)
2670 2671
2671 # TODO(mark): Return |data| for now because the generator needs a list of 2672 # TODO(mark): Return |data| for now because the generator needs a list of
2672 # build files that came in. In the future, maybe it should just accept 2673 # build files that came in. In the future, maybe it should just accept
2673 # a list, and not the whole data dict. 2674 # a list, and not the whole data dict.
2674 return [flat_list, targets, data] 2675 return [flat_list, targets, data]
OLDNEW
« no previous file with comments | « pylib/gyp/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698