OLD | NEW |
---|---|
1 # | 1 # |
2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 ], | 99 ], |
100 | 100 |
101 'generated_global_constructors_idl_files': [ | 101 'generated_global_constructors_idl_files': [ |
102 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', | 102 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', |
103 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', | 103 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', |
104 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.idl ', | 104 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.idl ', |
105 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors. idl', | 105 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors. idl', |
106 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', | 106 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', |
107 ], | 107 ], |
108 | 108 |
109 'compiler_module_files': [ | 109 # Python source |
110 'scripts/unstable/idl_compiler.py', | 110 'jinja_module_files': [ |
111 '<(DEPTH)/third_party/ply/lex.py', | |
112 '<(DEPTH)/third_party/ply/yacc.py', | |
113 # jinja2/__init__.py contains version string, so sufficient for package | 111 # jinja2/__init__.py contains version string, so sufficient for package |
114 '<(DEPTH)/third_party/jinja2/__init__.py', | 112 '<(DEPTH)/third_party/jinja2/__init__.py', |
115 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep | 113 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep |
114 ], | |
115 'compiler_module_files': [ | |
haraken
2014/02/26 04:40:04
idl_compiler_files ?
Nils Barth (inactive)
2014/02/26 06:45:45
Good point, that's clearer!
| |
116 'scripts/unstable/idl_compiler.py', | |
117 # PLY (Python Lex-Yacc) | |
118 '<(DEPTH)/third_party/ply/lex.py', | |
119 '<(DEPTH)/third_party/ply/yacc.py', | |
120 # Web IDL lexer/parser (base parser) | |
116 '<(DEPTH)/tools/idl_parser/idl_lexer.py', | 121 '<(DEPTH)/tools/idl_parser/idl_lexer.py', |
117 '<(DEPTH)/tools/idl_parser/idl_node.py', | 122 '<(DEPTH)/tools/idl_parser/idl_node.py', |
118 '<(DEPTH)/tools/idl_parser/idl_parser.py', | 123 '<(DEPTH)/tools/idl_parser/idl_parser.py', |
124 # Blink IDL lexer/parser/constructor | |
119 'scripts/unstable/blink_idl_lexer.py', | 125 'scripts/unstable/blink_idl_lexer.py', |
120 'scripts/unstable/blink_idl_parser.py', | 126 'scripts/unstable/blink_idl_parser.py', |
121 'scripts/unstable/code_generator_v8.py', | |
122 'scripts/unstable/idl_definitions.py', | 127 'scripts/unstable/idl_definitions.py', |
123 'scripts/unstable/idl_definitions_builder.py', | 128 'scripts/unstable/idl_definitions_builder.py', |
124 'scripts/unstable/idl_reader.py', | 129 'scripts/unstable/idl_reader.py', |
125 'scripts/unstable/idl_validator.py', | 130 'scripts/unstable/idl_validator.py', |
126 'scripts/unstable/interface_dependency_resolver.py', | 131 'scripts/unstable/interface_dependency_resolver.py', |
132 # V8 code generator | |
133 'scripts/unstable/code_generator_v8.py', | |
127 'scripts/unstable/v8_attributes.py', | 134 'scripts/unstable/v8_attributes.py', |
128 'scripts/unstable/v8_callback_interface.py', | 135 'scripts/unstable/v8_callback_interface.py', |
129 'scripts/unstable/v8_globals.py', | 136 'scripts/unstable/v8_globals.py', |
130 'scripts/unstable/v8_interface.py', | 137 'scripts/unstable/v8_interface.py', |
131 'scripts/unstable/v8_methods.py', | 138 'scripts/unstable/v8_methods.py', |
132 'scripts/unstable/v8_types.py', | 139 'scripts/unstable/v8_types.py', |
133 'scripts/unstable/v8_utilities.py', | 140 'scripts/unstable/v8_utilities.py', |
134 ], | 141 ], |
142 | |
143 # Jinja templates | |
135 'code_generator_template_files': [ | 144 'code_generator_template_files': [ |
136 'templates/attributes.cpp', | 145 'templates/attributes.cpp', |
137 'templates/callback_interface.cpp', | 146 'templates/callback_interface.cpp', |
138 'templates/callback_interface.h', | 147 'templates/callback_interface.h', |
139 'templates/interface_base.cpp', | 148 'templates/interface_base.cpp', |
140 'templates/interface.cpp', | 149 'templates/interface.cpp', |
141 'templates/interface.h', | 150 'templates/interface.h', |
142 'templates/methods.cpp', | 151 'templates/methods.cpp', |
143 ], | 152 ], |
144 | 153 |
145 'bindings_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/bindings', | 154 'bindings_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/bindings', |
146 | 155 |
147 'conditions': [ | 156 'conditions': [ |
148 # The bindings generator can skip writing generated files if they are | 157 # The bindings generator can skip writing generated files if they are |
149 # identical to the already existing file, which avoids recompilation. | 158 # identical to the already existing file, which avoids recompilation. |
150 # However, a dependency (earlier build step) having a newer timestamp than | 159 # However, a dependency (earlier build step) having a newer timestamp than |
151 # an output (later build step) confuses some build systems, so only use | 160 # an output (later build step) confuses some build systems, so only use |
152 # this on ninja, which explicitly supports this use case (gyp turns all | 161 # this on ninja, which explicitly supports this use case (gyp turns all |
153 # actions into ninja restat rules). | 162 # actions into ninja restat rules). |
154 ['"<(GENERATOR)"=="ninja"', { | 163 ['"<(GENERATOR)"=="ninja"', { |
155 'write_file_only_if_changed': '--write-file-only-if-changed 1', | 164 'write_file_only_if_changed': '--write-file-only-if-changed 1', |
156 }, { | 165 }, { |
157 'write_file_only_if_changed': '--write-file-only-if-changed 0', | 166 'write_file_only_if_changed': '--write-file-only-if-changed 0', |
158 }], | 167 }], |
159 ['OS!="win"', { | |
160 # This fails to import on Windows (running native perl) because of a | |
161 # dependency on JSON::XS (which is a separate module). It's necessary | |
162 # on Mac and CrOS. It's not generally necessary on standard Linux, but | |
163 # depending on what the user has locally it could be. So, don't use on | |
164 # Windows is the simplest solution. | |
165 'json_perl_module_include_path': '-I<(DEPTH)/third_party/JSON/out/lib/pe rl5', | |
166 }, { | |
167 'json_perl_module_include_path': '', | |
168 }], | |
169 ], | 168 ], |
170 }, | 169 }, |
171 | 170 |
172 'targets': [{ | 171 'targets': [{ |
173 'target_name': 'interfaces_info', | 172 'target_name': 'interfaces_info', |
174 'type': 'none', | 173 'type': 'none', |
175 'dependencies': [ | 174 'dependencies': [ |
176 '../core/core_generated.gyp:generated_testing_idls', | 175 '../core/core_generated.gyp:generated_testing_idls', |
177 ], | 176 ], |
178 'actions': [{ | 177 'actions': [{ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 '--event-names-file', | 217 '--event-names-file', |
219 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', | 218 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', |
220 '<@(write_file_only_if_changed)', | 219 '<@(write_file_only_if_changed)', |
221 '--', | 220 '--', |
222 '<@(generated_idl_files)', | 221 '<@(generated_idl_files)', |
223 ], | 222 ], |
224 'message': 'Computing global information about IDL files, and generating global scope constructor IDLs files and list of Event interfaces', | 223 'message': 'Computing global information about IDL files, and generating global scope constructor IDLs files and list of Event interfaces', |
225 }] | 224 }] |
226 }, | 225 }, |
227 { | 226 { |
227 # A separate pre-caching step is *required* to use bytecode caching in | |
228 # Jinja (which improves speed significantly), as the bytecode cache is | |
229 # not concurrency-safe on write; details in code_generator_v8.py. | |
230 'target_name': 'cached_jinja_templates', | |
231 'type': 'none', | |
232 'actions': [{ | |
233 'action_name': 'cache_jinja_templates', | |
234 'inputs': [ | |
235 '<@(jinja_module_files)', | |
236 'scripts/unstable/code_generator_v8.py', | |
237 '<@(code_generator_template_files)', | |
238 ], | |
239 'outputs': [ | |
240 '<(bindings_output_dir)/JINJA_CACHED', # Dummy to track dependency | |
haraken
2014/02/26 04:40:04
JINJA_CACHED => JinjaTemplate.cached ?
Nils Barth (inactive)
2014/02/26 06:45:45
I'd prefer ALL_CAPS: it's a dummy file (empty),
so
haraken
2014/02/26 06:49:11
Then JinjaTemplateDummyCache.cached ?
We want to
| |
241 ], | |
242 'action': [ | |
243 'python', | |
244 'scripts/unstable/code_generator_v8.py', | |
245 '<(bindings_output_dir)', | |
246 '<(bindings_output_dir)/JINJA_CACHED', | |
247 ], | |
248 'message': 'Caching bytecode of Jinja templates', | |
249 }], | |
250 }, | |
251 { | |
228 'target_name': 'individual_generated_bindings', | 252 'target_name': 'individual_generated_bindings', |
229 'type': 'none', | 253 'type': 'none', |
230 # The 'binding' rule generates .h files, so mark as hard_dependency, per: | 254 # The 'binding' rule generates .h files, so mark as hard_dependency, per: |
231 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies | 255 # https://code.google.com/p/gyp/wiki/InputFormatReference#Linking_Dependen cies |
232 'hard_dependency': 1, | 256 'hard_dependency': 1, |
233 'dependencies': [ | 257 'dependencies': [ |
234 'interfaces_info', | 258 'interfaces_info', |
259 'cached_jinja_templates', | |
235 '../core/core_generated.gyp:generated_testing_idls', | 260 '../core/core_generated.gyp:generated_testing_idls', |
236 ], | 261 ], |
237 'sources': [ | 262 'sources': [ |
238 '<@(interface_idl_files)', | 263 '<@(interface_idl_files)', |
239 ], | 264 ], |
240 'rules': [{ | 265 'rules': [{ |
241 'rule_name': 'binding', | 266 'rule_name': 'binding', |
242 'extension': 'idl', | 267 'extension': 'idl', |
243 'msvs_external_rule': 1, | 268 'msvs_external_rule': 1, |
244 'inputs': [ | 269 'inputs': [ |
245 'scripts/generate_bindings.pl', | 270 '<@(compiler_module_files)', |
246 'scripts/code_generator_v8.pm', | 271 '<(bindings_output_dir)/JINJA_CACHED', |
247 'scripts/idl_parser.pm', | |
248 'scripts/idl_serializer.pm', | |
249 '../build/scripts/preprocessor.pm', | |
250 'IDLExtendedAttributes.txt', | 272 'IDLExtendedAttributes.txt', |
251 # If the dependency structure or public interface info (e.g., | 273 # If the dependency structure or public interface info (e.g., |
252 # [ImplementedAs]) changes, we rebuild all files, since we're not | 274 # [ImplementedAs]) changes, we rebuild all files, since we're not |
253 # computing dependencies file-by-file in the build. | 275 # computing dependencies file-by-file in the build. |
254 # This data is generally stable. | 276 # This data is generally stable. |
255 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt', | |
256 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | 277 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', |
257 # Further, if any dependency (partial interface or implemented | 278 # Further, if any dependency (partial interface or implemented |
258 # interface) changes, rebuild everything, since every IDL potentially | 279 # interface) changes, rebuild everything, since every IDL potentially |
259 # depends on them, because we're not computing dependencies | 280 # depends on them, because we're not computing dependencies |
260 # file-by-file. | 281 # file-by-file. |
261 # FIXME: This is too conservative, and causes excess rebuilds: | 282 # FIXME: This is too conservative, and causes excess rebuilds: |
262 # compute this file-by-file. | 283 # compute this file-by-file. |
263 '<@(dependency_idl_files)', | 284 '<@(dependency_idl_files)', |
264 ], | 285 ], |
265 'outputs': [ | 286 'outputs': [ |
266 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp', | 287 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp', |
267 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h', | 288 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h', |
268 ], | 289 ], |
269 'variables': { | |
270 # IDL include paths. The generator will search recursively for IDL | |
271 # files under these locations. | |
272 'generator_include_dirs': [ | |
273 '--include', '../core', | |
274 '--include', '../modules', | |
275 '--include', '<(SHARED_INTERMEDIATE_DIR)/blink', | |
276 ], | |
277 # Hook for embedders to specify extra directories to find IDL files. | |
278 'extra_blink_generator_include_dirs%': [], | |
279 }, | |
280 # sanitize-win-build-log.sed uses a regex which matches this command | 290 # sanitize-win-build-log.sed uses a regex which matches this command |
281 # line (Perl script + .idl file being processed). | 291 # line (Python script + .idl file being processed). |
282 # Update that regex if command line changes (other than changing flags) | 292 # Update that regex if command line changes (other than changing flags) |
283 'action': [ | 293 'action': [ |
284 '<(perl_exe)', | 294 'python', |
285 '-w', | 295 'scripts/unstable/idl_compiler.py', |
286 '-Iscripts', | 296 '--output-dir', |
287 '-I../build/scripts', | |
288 '<@(json_perl_module_include_path)', | |
289 'scripts/generate_bindings.pl', | |
290 '--outputDir', | |
291 '<(bindings_output_dir)', | 297 '<(bindings_output_dir)', |
292 '--idlAttributesFile', | 298 '--idl-attributes-file', |
293 'IDLExtendedAttributes.txt', | 299 'IDLExtendedAttributes.txt', |
294 '<@(generator_include_dirs)', | 300 '--interfaces-info', |
295 '<@(extra_blink_generator_include_dirs)', | 301 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', |
296 '--interfaceDependenciesFile', | |
297 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfaceDependencies.txt', | |
298 '<@(preprocessor)', | |
299 '<@(write_file_only_if_changed)', | 302 '<@(write_file_only_if_changed)', |
300 '<(RULE_INPUT_PATH)', | 303 '<(RULE_INPUT_PATH)', |
301 ], | 304 ], |
302 'message': 'Generating binding from <(RULE_INPUT_PATH)', | 305 'message': 'Generating binding from <(RULE_INPUT_PATH)', |
303 }], | 306 }], |
304 }, | 307 }, |
305 { | 308 { |
306 'target_name': 'aggregate_generated_bindings', | 309 'target_name': 'aggregate_generated_bindings', |
307 'type': 'none', | 310 'type': 'none', |
308 'actions': [{ | 311 'actions': [{ |
(...skipping 23 matching lines...) Expand all Loading... | |
332 { | 335 { |
333 'target_name': 'generated_bindings', | 336 'target_name': 'generated_bindings', |
334 'type': 'none', | 337 'type': 'none', |
335 'dependencies': [ | 338 'dependencies': [ |
336 'aggregate_generated_bindings', | 339 'aggregate_generated_bindings', |
337 'individual_generated_bindings', | 340 'individual_generated_bindings', |
338 ], | 341 ], |
339 }, | 342 }, |
340 ], | 343 ], |
341 } | 344 } |
OLD | NEW |