| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni") | 5 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni") |
| 6 import("//third_party/WebKit/Source/bindings/modules/idl.gni") | 6 import("//third_party/WebKit/Source/bindings/modules/idl.gni") |
| 7 import("//third_party/WebKit/Source/bindings/modules/modules.gni") | 7 import("//third_party/WebKit/Source/bindings/modules/modules.gni") |
| 8 | 8 |
| 9 bindings_scripts_dir = get_path_info(".", "abspath") | 9 bindings_scripts_dir = get_path_info(".", "abspath") |
| 10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" | 10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 # Runs the idl_compiler script over a list of sources. | 114 # Runs the idl_compiler script over a list of sources. |
| 115 # | 115 # |
| 116 # Parameters: | 116 # Parameters: |
| 117 # sources = list of IDL files to compile | 117 # sources = list of IDL files to compile |
| 118 # output_dir = string containing the directory to put the output files. | 118 # output_dir = string containing the directory to put the output files. |
| 119 # output_name_suffix = a suffix after the basename of the output file names. | 119 # output_name_suffix = a suffix after the basename of the output file names. |
| 120 # target_component = component to generate code for. | 120 # target_component = component to generate code for. |
| 121 # is_web_modules = whether to generate C++ bindings for webmodules |
| 122 # or JS bindings for the web. |
| 121 template("idl_compiler") { | 123 template("idl_compiler") { |
| 122 output_dir = invoker.output_dir | 124 output_dir = invoker.output_dir |
| 123 output_name_suffix = invoker.output_name_suffix | 125 output_name_suffix = invoker.output_name_suffix |
| 124 | 126 |
| 125 action_foreach(target_name) { | 127 action_foreach(target_name) { |
| 126 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o | 128 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o |
| 127 # speed up startup. Figure out if we need this and do something similar (not | 129 # speed up startup. Figure out if we need this and do something similar (not |
| 128 # really expressible in GN now). | 130 # really expressible in GN now). |
| 129 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" | 131 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" |
| 130 | 132 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 145 # Further, if any dependency (partial interface or implemented | 147 # Further, if any dependency (partial interface or implemented |
| 146 # interface) changes, rebuild everything, since every IDL potentially | 148 # interface) changes, rebuild everything, since every IDL potentially |
| 147 # depends on them, because we're not computing dependencies | 149 # depends on them, because we're not computing dependencies |
| 148 # file-by-file. | 150 # file-by-file. |
| 149 # FIXME: This is too conservative, and causes excess rebuilds: | 151 # FIXME: This is too conservative, and causes excess rebuilds: |
| 150 # compute this file-by-file. http://crbug.com/341748 | 152 # compute this file-by-file. http://crbug.com/341748 |
| 151 # This should theoretically just be the IDL files passed in. | 153 # This should theoretically just be the IDL files passed in. |
| 152 inputs += all_dependency_idl_files | 154 inputs += all_dependency_idl_files |
| 153 | 155 |
| 154 sources = invoker.sources | 156 sources = invoker.sources |
| 155 outputs = [ | 157 |
| 156 "$output_dir/V8{{source_name_part}}${output_name_suffix}.cpp", | 158 if (invoker.is_web_modules) { |
| 157 "$output_dir/V8{{source_name_part}}${output_name_suffix}.h", | 159 outputs = [ |
| 158 ] | 160 "$output_dir/webmodules/WebModule{{source_name_part}}${output_name_suffi
x}.cpp", |
| 161 "$output_dir/webmodules/WebModule{{source_name_part}}${output_name_suffi
x}.h", |
| 162 ] |
| 163 } else { |
| 164 outputs = [ |
| 165 "$output_dir/v8/V8{{source_name_part}}${output_name_suffix}.cpp", |
| 166 "$output_dir/v8/V8{{source_name_part}}${output_name_suffix}.h", |
| 167 ] |
| 168 } |
| 159 | 169 |
| 160 args = [ | 170 args = [ |
| 161 "--cache-dir", | 171 "--cache-dir", |
| 162 rebase_path(bindings_scripts_output_dir, root_build_dir), | 172 rebase_path(bindings_scripts_output_dir, root_build_dir), |
| 163 "--output-dir", | 173 "--output-dir", |
| 164 rebase_path(output_dir, root_build_dir), | 174 rebase_path(output_dir, root_build_dir), |
| 165 "--info-dir", | 175 "--info-dir", |
| 166 rebase_path("$bindings_output_dir", root_build_dir), | 176 rebase_path("$bindings_output_dir", root_build_dir), |
| 167 "--write-file-only-if-changed=1", # Always true for Ninja. | 177 "--write-file-only-if-changed=1", # Always true for Ninja. |
| 168 "--target-component", | 178 "--target-component", |
| 169 invoker.target_component, | 179 invoker.target_component, |
| 170 "{{source}}", | |
| 171 ] | 180 ] |
| 172 | 181 |
| 182 if (invoker.is_web_modules) { |
| 183 args += [ "--web-modules" ] |
| 184 } |
| 185 args += [ "{{source}}" ] |
| 186 |
| 173 public_deps = [ | 187 public_deps = [ |
| 174 "//third_party/WebKit/Source/bindings/core:core_global_constructors_idls", | 188 "//third_party/WebKit/Source/bindings/core:core_global_constructors_idls", |
| 175 # FIXME: should be interfaces_info_core (w/o modules) | 189 # FIXME: should be interfaces_info_core (w/o modules) |
| 176 # http://crbug.com/358074 | 190 # http://crbug.com/358074 |
| 177 "//third_party/WebKit/Source/bindings/modules:interfaces_info", | 191 "//third_party/WebKit/Source/bindings/modules:interfaces_info", |
| 178 "//third_party/WebKit/Source/bindings/modules:modules_core_global_construc
tors_idls", | 192 "//third_party/WebKit/Source/bindings/modules:modules_core_global_construc
tors_idls", |
| 179 "//third_party/WebKit/Source/bindings/modules:modules_global_constructors_
idls", | 193 "//third_party/WebKit/Source/bindings/modules:modules_global_constructors_
idls", |
| 180 | 194 |
| 181 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", | 195 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", |
| 182 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", | 196 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 output_header_files += [ | 367 output_header_files += [ |
| 354 "$output_dir/${interface}${component}Constructors.h" | 368 "$output_dir/${interface}${component}Constructors.h" |
| 355 ] | 369 ] |
| 356 } | 370 } |
| 357 | 371 |
| 358 outputs = output_idl_files + output_header_files | 372 outputs = output_idl_files + output_header_files |
| 359 deps = invoker.deps | 373 deps = invoker.deps |
| 360 } | 374 } |
| 361 } | 375 } |
| 362 | 376 |
| OLD | NEW |