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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 args += [ "--suffix", invoker.suffix ] | 101 args += [ "--suffix", invoker.suffix ] |
102 } | 102 } |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 # Runs the idl_compiler script over a list of sources. | 106 # Runs the idl_compiler script over a list of sources. |
107 # | 107 # |
108 # Parameters: | 108 # Parameters: |
109 # sources = list of IDL files to compile | 109 # sources = list of IDL files to compile |
110 # output_dir = string containing the directory to put the output files. | 110 # output_dir = string containing the directory to put the output files. |
| 111 # output_name_suffix = a suffix after the basename of the output file names. |
| 112 # target_component = component to generate code for. |
111 template("idl_compiler") { | 113 template("idl_compiler") { |
112 output_dir = invoker.output_dir | 114 output_dir = invoker.output_dir |
| 115 output_name_suffix = invoker.output_name_suffix |
113 | 116 |
114 action_foreach(target_name) { | 117 action_foreach(target_name) { |
115 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o | 118 # TODO(brettw) GYP adds a "-S before the script name to skip "import site" t
o |
116 # speed up startup. Figure out if we need this and do something similar (not | 119 # speed up startup. Figure out if we need this and do something similar (not |
117 # really expressible in GN now). | 120 # really expressible in GN now). |
118 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" | 121 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" |
119 | 122 |
120 inputs = | 123 inputs = |
121 idl_lexer_parser_files + # to be explicit (covered by parsetab) | 124 idl_lexer_parser_files + # to be explicit (covered by parsetab) |
122 idl_compiler_files | 125 idl_compiler_files |
(...skipping 12 matching lines...) Expand all Loading... |
135 # interface) changes, rebuild everything, since every IDL potentially | 138 # interface) changes, rebuild everything, since every IDL potentially |
136 # depends on them, because we're not computing dependencies | 139 # depends on them, because we're not computing dependencies |
137 # file-by-file. | 140 # file-by-file. |
138 # FIXME: This is too conservative, and causes excess rebuilds: | 141 # FIXME: This is too conservative, and causes excess rebuilds: |
139 # compute this file-by-file. http://crbug.com/341748 | 142 # compute this file-by-file. http://crbug.com/341748 |
140 # This should theoretically just be the IDL files passed in. | 143 # This should theoretically just be the IDL files passed in. |
141 inputs += all_dependency_idl_files | 144 inputs += all_dependency_idl_files |
142 | 145 |
143 sources = invoker.sources | 146 sources = invoker.sources |
144 outputs = [ | 147 outputs = [ |
145 "$output_dir/V8{{source_name_part}}.cpp", | 148 "$output_dir/V8{{source_name_part}}${output_name_suffix}.cpp", |
146 "$output_dir/V8{{source_name_part}}.h", | 149 "$output_dir/V8{{source_name_part}}${output_name_suffix}.h", |
147 ] | 150 ] |
148 | 151 |
149 args = [ | 152 args = [ |
150 "--cache-dir", | 153 "--cache-dir", |
151 rebase_path(bindings_scripts_output_dir, root_build_dir), | 154 rebase_path(bindings_scripts_output_dir, root_build_dir), |
152 "--output-dir", | 155 "--output-dir", |
153 rebase_path(output_dir, root_build_dir), | 156 rebase_path(output_dir, root_build_dir), |
154 "--interfaces-info", | 157 "--interfaces-info", |
155 rebase_path("$bindings_modules_output_dir/InterfacesInfoModules.pickle", | 158 rebase_path("$bindings_modules_output_dir/InterfacesInfoModules.pickle", |
156 root_build_dir), | 159 root_build_dir), |
157 "--write-file-only-if-changed=1", # Always true for Ninja. | 160 "--write-file-only-if-changed=1", # Always true for Ninja. |
| 161 "--target-component", |
| 162 invoker.target_component, |
158 "{{source}}", | 163 "{{source}}", |
159 ] | 164 ] |
160 | 165 |
161 deps = [ | 166 deps = [ |
162 # FIXME: should be interfaces_info_core (w/o modules) | 167 # FIXME: should be interfaces_info_core (w/o modules) |
163 # http://crbug.com/358074 | 168 # http://crbug.com/358074 |
164 "//third_party/WebKit/Source/bindings/modules:interfaces_info", | 169 "//third_party/WebKit/Source/bindings/modules:interfaces_info", |
165 | 170 |
166 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", | 171 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", |
167 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", | 172 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 output_header_files += [ | 327 output_header_files += [ |
323 "$output_dir/${interface}${component}Constructors.h" | 328 "$output_dir/${interface}${component}Constructors.h" |
324 ] | 329 ] |
325 } | 330 } |
326 | 331 |
327 outputs = output_idl_files + output_header_files | 332 outputs = output_idl_files + output_header_files |
328 deps = invoker.deps | 333 deps = invoker.deps |
329 } | 334 } |
330 } | 335 } |
331 | 336 |
OLD | NEW |