Index: Source/bindings/scripts/scripts.gni |
diff --git a/Source/bindings/scripts/scripts.gni b/Source/bindings/scripts/scripts.gni |
index 41a80c6f3dd34cd3746b42912a68bfa6c84bf10e..ccf69a5a0e9b26a91f61a2b92327e0fe9e5f6a99 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,96 @@ 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) ] |
+ |
+ deps = invoker.deps |
+ } |
+} |
+ |
+# 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. |
+# component = component to generate global constructors for. |
+# output_dir = output directory to generate idl files and header files. |
+# 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 |
+ |
+ 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. |
+ "--", |
+ ] |
+ |
+ output_dir = invoker.output_dir |
+ component = invoker.component |
+ |
+ # generate outputs from invoker.interfaces. |
+ output_idl_files = [] |
+ output_header_files = [] |
+ foreach(interface, invoker.interfaces) { |
+ args += [ interface ] |
+ output_idl_file = "$output_dir/${interface}${component}Constructors.idl" |
+ output_header_file = "$output_dir/${interface}${component}Constructors.h" |
+ args += [ rebase_path(output_idl_file, root_build_dir) ] |
+ output_idl_files += [ output_idl_file ] |
+ output_header_files += [ output_header_file ] |
+ } |
+ |
+ outputs = output_idl_files + output_header_files |
+ deps = invoker.deps |
+ } |
+} |
+ |