Chromium Code Reviews| Index: Source/bindings/scripts/scripts.gni |
| diff --git a/Source/bindings/scripts/scripts.gni b/Source/bindings/scripts/scripts.gni |
| index 41a80c6f3dd34cd3746b42912a68bfa6c84bf10e..25bdc428d9e6314f87b3e268139d3909247c4910 100644 |
| --- a/Source/bindings/scripts/scripts.gni |
| +++ b/Source/bindings/scripts/scripts.gni |
| @@ -28,6 +28,7 @@ idl_compiler_files = get_path_info(_gypi.idl_compiler_files, "abspath") |
| # sources_generated = list of generated IDL files to pass as inputs |
| # component_dir = name if subdirectory (one word, no slashes) of component. |
| # output_file = pickle file to write |
| +# deps = dependencies |
| # |
| # FIXME: Note the static/generated split is for consistency with GYP. This |
| # split is not necessary in the GN build and could be combined into a single |
| @@ -61,11 +62,7 @@ template("compute_interfaces_info_individual") { |
| "--", |
| ] + rebase_path(invoker.sources_generated, root_build_dir) |
| - deps = [ |
| - # FIXME: should be {modules|core}_generated_idls |
| - # http://crbug.com/358074 |
| - "//third_party/WebKit/Source/bindings:generated_idls", |
| - ] |
| + deps = invoker.deps |
| } |
| } |
| @@ -238,3 +235,91 @@ template("aggregate_generated_bindings") { |
| args += rebase_path(invoker.outputs, root_build_dir) |
| } |
| } |
| + |
| +# Calls the compute_global_objects script. |
| +# |
| +# Parameters: |
| +# sources = a list of source IDL files. |
| +# sources_generated = a list of generated pickle sources. |
| +# output_file = a pickle file to write to (need to specify directory) |
| +# |
| +template("compute_global_objects") { |
| + action(target_name) { |
| + script = "//third_party/WebKit/Source/bindings/scripts/compute_global_objects.py" |
| + |
| + # Write the file list to a unique temp file to avoid blowing out the |
| + # command line length limit. |
| + idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" |
| + write_file(idl_files_list, |
| + rebase_path(invoker.sources, root_build_dir)) |
| + |
| + inputs = [ |
| + "//third_party/WebKit/Source/bindings/scripts/utilities.py", |
| + idl_files_list, |
| + ] + invoker.sources_generated + invoker.sources |
| + |
| + outputs = [ invoker.output_file ] |
| + |
| + args = [ |
| + "--idl-files-list", |
| + rebase_path(idl_files_list, root_build_dir), |
| + "--write-file-only-if-changed=1", # Always true for Ninja. |
| + "--", |
| + ] |
| + args += rebase_path(invoker.sources_generated, root_build_dir) |
| + args += [ rebase_path(invoker.output_file, root_build_dir) ] |
| + } |
| +} |
| + |
| +# Calls the generate_global_constructors script. |
| +# |
| +# Parameters: |
| +# sources = a list of source IDL files. |
| +# global_objects_file = a global objects file generated by compute_global_objects |
| +# interfaces = interfaces to generate global constructors for. |
| +# output_idl_file = a list of IDL files to write to. |
|
brettw
2014/10/08 18:28:33
you need an "s" at the end of the var name. I thin
tasak
2014/10/14 11:51:33
Done.
Autogenerated the .idl names and headers.
|
| +# output_header_file = a list of cpp header files to write to. |
| +# deps = dependencies |
| +# |
| +template("generate_global_constructors") { |
| + action(target_name) { |
| + script = "//third_party/WebKit/Source/bindings/scripts/generate_global_constructors.py" |
| + |
| + # Write the file list to a unique temp file to avoid blowing out the |
| + # command line length limit. |
| + idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" |
| + write_file(idl_files_list, |
| + rebase_path(invoker.sources, root_build_dir)) |
| + |
| + inputs = [ |
| + "//third_party/WebKit/Source/bindings/scripts/utilities.py", |
| + idl_files_list, |
| + invoker.global_objects_file, |
| + ] + invoker.sources |
| + |
| + outputs = invoker.output_idl_files + invoker.output_header_files |
| + |
| + args = [ |
| + "--idl-files-list", |
| + rebase_path(idl_files_list, root_build_dir), |
| + "--global-objects-file", |
| + rebase_path(invoker.global_objects_file, root_build_dir), |
| + "--write-file-only-if-changed=1", # Always true for Ninja. |
| + "--", |
| + ] |
| + |
| + # Generate zip(interfaces, output_idl_files), because |
| + # generate_global_constructors.py requries |
| + # -- interace output_idl_file (interface output_idl_file)* |
| + i = 0 |
| + output_idl_files = invoker.output_idl_files |
| + foreach(interface, invoker.interfaces) { |
| + args += [ interface ] |
| + args += [ rebase_path(output_idl_files[i], root_build_dir) ] |
| + i = i + 1 |
| + } |
| + |
| + deps = invoker.deps |
| + } |
| +} |
| + |