Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 # | 29 # |
| 30 | 30 |
| 31 # Generate IDL bindings, together with auxiliary files | 31 # Generate IDL bindings, together with auxiliary files |
| 32 # (constructors on global objects, aggregate bindings files). | 32 # (constructors on global objects, aggregate bindings files). |
| 33 # | 33 # |
| 34 # Design doc: http://www.chromium.org/developers/design-documents/idl-build | 34 # Design doc: http://www.chromium.org/developers/design-documents/idl-build |
| 35 | 35 |
| 36 { | 36 { |
| 37 'includes': [ | 37 'includes': [ |
| 38 '../build/scripts/scripts.gypi', | 38 'bindings.gypi', |
| 39 '../build/win/precompile.gypi', | |
|
Nils Barth (inactive)
2014/04/01 06:20:38
These includes are unnecessary, and note that scri
| |
| 40 '../build/scripts/scripts.gypi', | |
| 41 '../core/core.gypi', | 39 '../core/core.gypi', |
| 42 '../modules/modules.gypi', | 40 '../modules/modules.gypi', |
| 43 'bindings.gypi', | |
| 44 ], | 41 ], |
| 45 | 42 |
| 46 'variables': { | 43 'variables': { |
| 47 # IDL file lists; see: http://www.chromium.org/developers/web-idl-interfaces | 44 # IDL file lists; see: http://www.chromium.org/developers/web-idl-interfaces |
| 48 # | 45 # |
| 49 # Interface IDL files / Dependency IDL files | 46 # Interface IDL files / Dependency IDL files |
| 50 # Interface IDL files: generate individual bindings (includes testing) | 47 # Interface IDL files: generate individual bindings (includes testing) |
| 51 'interface_idl_files': [ | 48 'interface_idl_files': [ |
| 52 '<@(static_interface_idl_files)', | 49 '<@(static_interface_idl_files)', |
| 53 '<@(generated_interface_idl_files)', | 50 '<@(generated_interface_idl_files)', |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 95 |
| 99 # Generated IDL files | 96 # Generated IDL files |
| 100 'generated_interface_idl_files': [ | 97 'generated_interface_idl_files': [ |
| 101 '<@(generated_webcore_testing_idl_files)', # interfaces | 98 '<@(generated_webcore_testing_idl_files)', # interfaces |
| 102 ], | 99 ], |
| 103 'generated_dependency_idl_files': [ | 100 'generated_dependency_idl_files': [ |
| 104 '<@(generated_global_constructors_idl_files)', # partial interfaces | 101 '<@(generated_global_constructors_idl_files)', # partial interfaces |
| 105 ], | 102 ], |
| 106 | 103 |
| 107 'generated_global_constructors_idl_files': [ | 104 'generated_global_constructors_idl_files': [ |
| 108 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', | 105 '<(blink_output_dir)/WindowConstructors.idl', |
| 109 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', | 106 '<(blink_output_dir)/WorkerGlobalScopeConstructors.idl', |
| 110 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.idl' , | 107 '<(blink_output_dir)/SharedWorkerGlobalScopeConstructors.idl', |
| 111 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors.i dl', | 108 '<(blink_output_dir)/DedicatedWorkerGlobalScopeConstructors.idl', |
| 112 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', | 109 '<(blink_output_dir)/ServiceWorkerGlobalScopeConstructors.idl', |
| 113 ], | 110 ], |
| 114 | 111 |
| 115 'generated_global_constructors_header_files': [ | 112 'generated_global_constructors_header_files': [ |
| 116 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.h', | 113 '<(blink_output_dir)/WindowConstructors.h', |
| 117 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.h', | 114 '<(blink_output_dir)/WorkerGlobalScopeConstructors.h', |
| 118 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.h', | 115 '<(blink_output_dir)/SharedWorkerGlobalScopeConstructors.h', |
| 119 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors.h ', | 116 '<(blink_output_dir)/DedicatedWorkerGlobalScopeConstructors.h', |
| 120 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.h', | 117 '<(blink_output_dir)/ServiceWorkerGlobalScopeConstructors.h', |
| 121 ], | 118 ], |
| 122 | 119 |
| 123 | 120 |
| 124 # Python source | 121 # Python source |
| 125 'jinja_module_files': [ | 122 'jinja_module_files': [ |
| 126 # jinja2/__init__.py contains version string, so sufficient for package | 123 # jinja2/__init__.py contains version string, so sufficient for package |
| 127 '<(DEPTH)/third_party/jinja2/__init__.py', | 124 '<(DEPTH)/third_party/jinja2/__init__.py', |
| 128 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep | 125 '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep |
| 129 ], | 126 ], |
| 130 'idl_lexer_parser_files': [ | 127 'idl_lexer_parser_files': [ |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 160 # Jinja templates | 157 # Jinja templates |
| 161 'code_generator_template_files': [ | 158 'code_generator_template_files': [ |
| 162 'templates/attributes.cpp', | 159 'templates/attributes.cpp', |
| 163 'templates/callback_interface.cpp', | 160 'templates/callback_interface.cpp', |
| 164 'templates/callback_interface.h', | 161 'templates/callback_interface.h', |
| 165 'templates/interface_base.cpp', | 162 'templates/interface_base.cpp', |
| 166 'templates/interface.cpp', | 163 'templates/interface.cpp', |
| 167 'templates/interface.h', | 164 'templates/interface.h', |
| 168 'templates/methods.cpp', | 165 'templates/methods.cpp', |
| 169 ], | 166 ], |
| 170 | |
| 171 | |
| 172 'bindings_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/bindings', | |
| 173 | |
| 174 'conditions': [ | |
| 175 # The bindings generator can skip writing generated files if they are | |
| 176 # identical to the already existing file, which avoids recompilation. | |
| 177 # However, a dependency (earlier build step) having a newer timestamp than | |
| 178 # an output (later build step) confuses some build systems, so only use | |
| 179 # this on ninja, which explicitly supports this use case (gyp turns all | |
| 180 # actions into ninja restat rules). | |
| 181 ['"<(GENERATOR)"=="ninja"', { | |
| 182 'write_file_only_if_changed': '--write-file-only-if-changed 1', | |
| 183 }, { | |
| 184 'write_file_only_if_changed': '--write-file-only-if-changed 0', | |
| 185 }], | |
| 186 ], | |
| 187 }, | 167 }, |
| 188 | 168 |
| 189 'targets': [ | 169 'targets': [ |
| 190 ################################################################################ | 170 ################################################################################ |
| 191 { | 171 { |
| 192 'target_name': 'global_constructors_idls', | 172 'target_name': 'global_constructors_idls', |
| 193 'type': 'none', | 173 'type': 'none', |
| 194 'actions': [{ | 174 'actions': [{ |
| 195 'action_name': 'generate_global_constructors_idls', | 175 'action_name': 'generate_global_constructors_idls', |
| 196 'inputs': [ | 176 'inputs': [ |
| 197 'scripts/generate_global_constructors.py', | 177 'scripts/generate_global_constructors.py', |
| 198 'scripts/utilities.py', | 178 'scripts/utilities.py', |
| 199 # Only includes main IDL files (exclude dependencies and testing, | 179 # Only includes main IDL files (exclude dependencies and testing, |
| 200 # which should not appear on global objects). | 180 # which should not appear on global objects). |
| 201 '<(main_interface_idl_files_list)', | 181 '<(main_interface_idl_files_list)', |
| 202 '<@(main_interface_idl_files)', | 182 '<@(main_interface_idl_files)', |
| 203 ], | 183 ], |
| 204 'outputs': [ | 184 'outputs': [ |
| 205 '<@(generated_global_constructors_idl_files)', | 185 '<@(generated_global_constructors_idl_files)', |
| 206 '<@(generated_global_constructors_header_files)', | 186 '<@(generated_global_constructors_header_files)', |
| 207 ], | 187 ], |
| 208 'action': [ | 188 'action': [ |
| 209 'python', | 189 'python', |
| 210 'scripts/generate_global_constructors.py', | 190 'scripts/generate_global_constructors.py', |
| 211 '--idl-files-list', | 191 '--idl-files-list', |
| 212 '<(main_interface_idl_files_list)', | 192 '<(main_interface_idl_files_list)', |
| 213 '<@(write_file_only_if_changed)', | 193 '--write-file-only-if-changed', |
|
Nils Barth (inactive)
2014/04/01 06:20:38
List context expansion is confusing here;
better t
| |
| 194 '<(write_file_only_if_changed)', | |
| 214 '--', | 195 '--', |
| 215 'Window', | 196 'Window', |
| 216 '<(SHARED_INTERMEDIATE_DIR)/blink/WindowConstructors.idl', | 197 '<(blink_output_dir)/WindowConstructors.idl', |
| 217 'WorkerGlobalScope', | 198 'WorkerGlobalScope', |
| 218 '<(SHARED_INTERMEDIATE_DIR)/blink/WorkerGlobalScopeConstructors.idl', | 199 '<(blink_output_dir)/WorkerGlobalScopeConstructors.idl', |
| 219 'SharedWorkerGlobalScope', | 200 'SharedWorkerGlobalScope', |
| 220 '<(SHARED_INTERMEDIATE_DIR)/blink/SharedWorkerGlobalScopeConstructors.id l', | 201 '<(blink_output_dir)/SharedWorkerGlobalScopeConstructors.idl', |
| 221 'DedicatedWorkerGlobalScope', | 202 'DedicatedWorkerGlobalScope', |
| 222 '<(SHARED_INTERMEDIATE_DIR)/blink/DedicatedWorkerGlobalScopeConstructors .idl', | 203 '<(blink_output_dir)/DedicatedWorkerGlobalScopeConstructors.idl', |
| 223 'ServiceWorkerGlobalScope', | 204 'ServiceWorkerGlobalScope', |
| 224 '<(SHARED_INTERMEDIATE_DIR)/ServiceWorkerGlobalScopeConstructors.idl', | 205 '<(blink_output_dir)/ServiceWorkerGlobalScopeConstructors.idl', |
|
Nils Barth (inactive)
2014/04/01 06:20:38
Notice the error in ServiceWorker?
(Missed blink/
| |
| 225 ], | 206 ], |
| 226 'message': 'Generating IDL files for constructors on global objects', | 207 'message': 'Generating IDL files for constructors on global objects', |
| 227 }] | 208 }] |
| 228 }, | 209 }, |
| 229 ################################################################################ | 210 ################################################################################ |
| 230 { | 211 { |
| 231 'target_name': 'interfaces_info', | 212 'target_name': 'interfaces_info', |
| 232 'type': 'none', | 213 'type': 'none', |
| 233 'dependencies': [ | 214 'dependencies': [ |
| 234 # Generated IDLs | 215 # Generated IDLs |
| 235 'global_constructors_idls', | 216 'global_constructors_idls', |
| 236 '../core/core_generated.gyp:generated_testing_idls', | 217 '../core/core_generated.gyp:generated_testing_idls', |
| 237 ], | 218 ], |
| 238 'actions': [{ | 219 'actions': [{ |
| 239 'action_name': 'compute_interfaces_info', | 220 'action_name': 'compute_interfaces_info', |
| 240 'inputs': [ | 221 'inputs': [ |
| 241 'scripts/compute_interfaces_info.py', | 222 'scripts/compute_interfaces_info.py', |
| 242 'scripts/utilities.py', | 223 'scripts/utilities.py', |
| 243 '<(static_idl_files_list)', | 224 '<(static_idl_files_list)', |
| 244 '<@(static_idl_files)', | 225 '<@(static_idl_files)', |
| 245 '<@(generated_idl_files)', | 226 '<@(generated_idl_files)', |
| 246 ], | 227 ], |
| 247 'outputs': [ | 228 'outputs': [ |
| 248 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | 229 '<(blink_output_dir)/InterfacesInfo.pickle', |
| 249 ], | 230 ], |
| 250 'action': [ | 231 'action': [ |
| 251 'python', | 232 'python', |
| 252 'scripts/compute_interfaces_info.py', | 233 'scripts/compute_interfaces_info.py', |
| 253 '--idl-files-list', | 234 '--idl-files-list', |
| 254 '<(static_idl_files_list)', | 235 '<(static_idl_files_list)', |
| 255 '--interfaces-info-file', | 236 '--interfaces-info-file', |
| 256 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | 237 '<(blink_output_dir)/InterfacesInfo.pickle', |
| 257 '<@(write_file_only_if_changed)', | 238 '--write-file-only-if-changed', |
| 239 '<(write_file_only_if_changed)', | |
| 258 '--', | 240 '--', |
| 259 # Generated files must be passed at command line | 241 # Generated files must be passed at command line |
| 260 '<@(generated_idl_files)', | 242 '<@(generated_idl_files)', |
| 261 ], | 243 ], |
| 262 'message': 'Computing global information about IDL files', | 244 'message': 'Computing global information about IDL files', |
| 263 }] | 245 }] |
| 264 }, | 246 }, |
| 265 ################################################################################ | 247 ################################################################################ |
| 266 { | 248 { |
| 267 'target_name': 'event_interfaces', | |
| 268 'type': 'none', | |
| 269 'dependencies': [ | |
| 270 'interfaces_info', | |
| 271 ], | |
| 272 'actions': [{ | |
| 273 'action_name': 'generate_event_interfaces', | |
| 274 'inputs': [ | |
| 275 'scripts/generate_event_interfaces.py', | |
| 276 'scripts/utilities.py', | |
| 277 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | |
| 278 ], | |
| 279 'outputs': [ | |
| 280 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', | |
| 281 ], | |
| 282 'action': [ | |
| 283 'python', | |
| 284 'scripts/generate_event_interfaces.py', | |
| 285 '--interfaces-info-file', | |
| 286 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | |
| 287 '--event-interfaces-file', | |
| 288 '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in', | |
| 289 '<@(write_file_only_if_changed)', | |
| 290 ], | |
| 291 'message': 'Generating list of Event interfaces', | |
| 292 }] | |
| 293 }, | |
| 294 ################################################################################ | |
| 295 { | |
| 296 # A separate pre-caching step is *not required* to use lex/parse table | 249 # A separate pre-caching step is *not required* to use lex/parse table |
| 297 # caching in PLY, as the caches are concurrency-safe. | 250 # caching in PLY, as the caches are concurrency-safe. |
| 298 # However, pre-caching ensures that all compiler processes use the cached | 251 # However, pre-caching ensures that all compiler processes use the cached |
| 299 # files (hence maximizing speed), instead of early processes building the | 252 # files (hence maximizing speed), instead of early processes building the |
| 300 # tables themselves (as they've not yet been written when they start). | 253 # tables themselves (as they've not yet been written when they start). |
| 301 'target_name': 'cached_yacc_tables', | 254 'target_name': 'cached_yacc_tables', |
| 302 'type': 'none', | 255 'type': 'none', |
| 303 'actions': [{ | 256 'actions': [{ |
| 304 'action_name': 'cache_yacc_tables', | 257 'action_name': 'cache_yacc_tables', |
| 305 'inputs': [ | 258 'inputs': [ |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 '<@(idl_lexer_parser_files)', # to be explicit (covered by parsetab) | 320 '<@(idl_lexer_parser_files)', # to be explicit (covered by parsetab) |
| 368 '<@(idl_compiler_files)', | 321 '<@(idl_compiler_files)', |
| 369 '<(bindings_output_dir)/lextab.py', | 322 '<(bindings_output_dir)/lextab.py', |
| 370 '<(bindings_output_dir)/parsetab.pickle', | 323 '<(bindings_output_dir)/parsetab.pickle', |
| 371 '<(bindings_output_dir)/cached_jinja_templates.stamp', | 324 '<(bindings_output_dir)/cached_jinja_templates.stamp', |
| 372 'IDLExtendedAttributes.txt', | 325 'IDLExtendedAttributes.txt', |
| 373 # If the dependency structure or public interface info (e.g., | 326 # If the dependency structure or public interface info (e.g., |
| 374 # [ImplementedAs]) changes, we rebuild all files, since we're not | 327 # [ImplementedAs]) changes, we rebuild all files, since we're not |
| 375 # computing dependencies file-by-file in the build. | 328 # computing dependencies file-by-file in the build. |
| 376 # This data is generally stable. | 329 # This data is generally stable. |
| 377 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | 330 '<(blink_output_dir)/InterfacesInfo.pickle', |
| 378 # Further, if any dependency (partial interface or implemented | 331 # Further, if any dependency (partial interface or implemented |
| 379 # interface) changes, rebuild everything, since every IDL potentially | 332 # interface) changes, rebuild everything, since every IDL potentially |
| 380 # depends on them, because we're not computing dependencies | 333 # depends on them, because we're not computing dependencies |
| 381 # file-by-file. | 334 # file-by-file. |
| 382 # FIXME: This is too conservative, and causes excess rebuilds: | 335 # FIXME: This is too conservative, and causes excess rebuilds: |
| 383 # compute this file-by-file. http://crbug.com/341748 | 336 # compute this file-by-file. http://crbug.com/341748 |
| 384 '<@(dependency_idl_files)', | 337 '<@(dependency_idl_files)', |
| 385 ], | 338 ], |
| 386 'outputs': [ | 339 'outputs': [ |
| 387 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp', | 340 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).cpp', |
| 388 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h', | 341 '<(bindings_output_dir)/V8<(RULE_INPUT_ROOT).h', |
| 389 ], | 342 ], |
| 390 # sanitize-win-build-log.sed uses a regex which matches this command | 343 # sanitize-win-build-log.sed uses a regex which matches this command |
| 391 # line (Python script + .idl file being processed). | 344 # line (Python script + .idl file being processed). |
| 392 # Update that regex if command line changes (other than changing flags) | 345 # Update that regex if command line changes (other than changing flags) |
| 393 'action': [ | 346 'action': [ |
| 394 'python', | 347 'python', |
| 395 '-S', # skip 'import site' to speed up startup | 348 '-S', # skip 'import site' to speed up startup |
| 396 'scripts/idl_compiler.py', | 349 'scripts/idl_compiler.py', |
| 397 '--output-dir', | 350 '--output-dir', |
| 398 '<(bindings_output_dir)', | 351 '<(bindings_output_dir)', |
| 399 '--interfaces-info', | 352 '--interfaces-info', |
| 400 '<(SHARED_INTERMEDIATE_DIR)/blink/InterfacesInfo.pickle', | 353 '<(blink_output_dir)/InterfacesInfo.pickle', |
| 401 '<@(write_file_only_if_changed)', | 354 '--write-file-only-if-changed', |
| 355 '<(write_file_only_if_changed)', | |
| 402 '<(RULE_INPUT_PATH)', | 356 '<(RULE_INPUT_PATH)', |
| 403 ], | 357 ], |
| 404 'message': 'Generating binding from <(RULE_INPUT_PATH)', | 358 'message': 'Generating binding from <(RULE_INPUT_PATH)', |
| 405 }], | 359 }], |
| 406 }, | 360 }, |
| 407 ################################################################################ | 361 ################################################################################ |
| 408 { | 362 { |
| 409 'target_name': 'aggregate_generated_bindings', | 363 'target_name': 'aggregate_generated_bindings', |
| 410 'type': 'none', | 364 'type': 'none', |
| 411 'actions': [{ | 365 'actions': [{ |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 428 ], | 382 ], |
| 429 'message': 'Generating aggregate generated bindings files', | 383 'message': 'Generating aggregate generated bindings files', |
| 430 }], | 384 }], |
| 431 }, | 385 }, |
| 432 ################################################################################ | 386 ################################################################################ |
| 433 { | 387 { |
| 434 'target_name': 'generated_bindings', | 388 'target_name': 'generated_bindings', |
| 435 'type': 'none', | 389 'type': 'none', |
| 436 'dependencies': [ | 390 'dependencies': [ |
| 437 'aggregate_generated_bindings', | 391 'aggregate_generated_bindings', |
| 438 'event_interfaces', | |
|
Nils Barth (inactive)
2014/04/01 06:20:38
Now 'generated_bindings' is actually just bindings
| |
| 439 'individual_generated_bindings', | 392 'individual_generated_bindings', |
| 440 ], | 393 ], |
| 441 }, | 394 }, |
| 442 ################################################################################ | 395 ################################################################################ |
| 443 ], # targets | 396 ], # targets |
| 444 } | 397 } |
| OLD | NEW |