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

Side by Side Diff: platform_tools/android/gyp_gen/gypd_parser.py

Issue 198063002: Updates to Android.mk generation. (Closed) Base URL: https://skia.googlesource.com/skia.git@android_mk
Patch Set: Rebase Created 6 years, 8 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright 2014 Google Inc. 3 # Copyright 2014 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 """ 8 """
9 Functions for parsing the gypd output from gyp. 9 Functions for parsing the gypd output from gyp.
10 """ 10 """
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 include = include.replace('..', '$(LOCAL_PATH)', 1) 82 include = include.replace('..', '$(LOCAL_PATH)', 1)
83 # Remove a trailing slash, if present. 83 # Remove a trailing slash, if present.
84 if include.endswith('/'): 84 if include.endswith('/'):
85 include = include[:-1] 85 include = include[:-1]
86 var_dict.LOCAL_C_INCLUDES.add(include) 86 var_dict.LOCAL_C_INCLUDES.add(include)
87 # For the top level, libskia, include directories should be exported. 87 # For the top level, libskia, include directories should be exported.
88 if current_target_name == 'libskia': 88 if current_target_name == 'libskia':
89 var_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add(include) 89 var_dict.LOCAL_EXPORT_C_INCLUDE_DIRS.add(include)
90 90
91 for define in d.get('defines', []): 91 for define in d.get('defines', []):
92 var_dict.LOCAL_CFLAGS.add('-D' + define) 92 var_dict.DEFINES.add(define)
93 93
94 94
95 def parse_gypd(var_dict, path, desired_targets=None): 95 def parse_gypd(var_dict, path, desired_targets=None):
96 """ 96 """
97 Parse a gypd file. 97 Parse a gypd file.
98 @param var_dict VarsDict object for storing the result of the parse. 98 @param var_dict VarsDict object for storing the result of the parse.
99 @param path Path to gypd file. 99 @param path Path to gypd file.
100 @param desired_targets List of targets to be parsed from this file. If empty, 100 @param desired_targets List of targets to be parsed from this file. If empty,
101 parse all targets. 101 parse all targets.
102 """ 102 """
(...skipping 10 matching lines...) Expand all
113 # Avoid circular dependencies 113 # Avoid circular dependencies
114 continue 114 continue
115 if desired_targets and target_name not in desired_targets: 115 if desired_targets and target_name not in desired_targets:
116 # Our caller does not depend on this one 116 # Our caller does not depend on this one
117 continue 117 continue
118 # Add it to our known targets so we don't parse it again 118 # Add it to our known targets so we don't parse it again
119 var_dict.KNOWN_TARGETS.add(target_name) 119 var_dict.KNOWN_TARGETS.add(target_name)
120 120
121 parse_dictionary(var_dict, target, target_name) 121 parse_dictionary(var_dict, target, target_name)
122 122
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698