| 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 # Instantiate grit. This will produce a script target to run grit, and a | 5 # Instantiate grit. This will produce a script target to run grit, and a |
| 6 # static library that compiles the .cc files. | 6 # static library that compiles the .cc files. |
| 7 # | 7 # |
| 8 # Parameters | 8 # Parameters |
| 9 # | 9 # |
| 10 # source | 10 # source |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 # the current one. | 180 # the current one. |
| 181 grit_inputs = rebase_path(grit_inputs_build_rel, ".", root_build_dir) + [ | 181 grit_inputs = rebase_path(grit_inputs_build_rel, ".", root_build_dir) + [ |
| 182 grit_resource_id_file, | 182 grit_resource_id_file, |
| 183 ] | 183 ] |
| 184 | 184 |
| 185 grit_outputs_build_rel = exec_script(grit_info_script, | 185 grit_outputs_build_rel = exec_script(grit_info_script, |
| 186 [ "--outputs", "$output_dir", source_path, "-f", resource_ids ] + | 186 [ "--outputs", "$output_dir", source_path, "-f", resource_ids ] + |
| 187 grit_flags, | 187 grit_flags, |
| 188 "list lines") | 188 "list lines") |
| 189 | 189 |
| 190 # The inputs are relative to the current (build) directory, rebase to | 190 # The names returned by grit are relative to the current (build) directory, |
| 191 # the current one. | 191 # but references to files in this template are expected to be relative to the |
| 192 grit_outputs = rebase_path(grit_outputs_build_rel, ".", root_build_dir) | 192 # invoking BUILD.gn file's directory. Make it absolute so there's no |
| 193 # ambiguity. |
| 194 grit_outputs = get_path_info( |
| 195 rebase_path(grit_outputs_build_rel, ".", root_build_dir), "abspath") |
| 193 | 196 |
| 194 # The config and the action below get this visibility son only the generated | 197 # The config and the action below get this visibility son only the generated |
| 195 # source set can depend on them. The variable "target_name" will get | 198 # source set can depend on them. The variable "target_name" will get |
| 196 # overwritten inside the innter classes so we need to compute it here. | 199 # overwritten inside the innter classes so we need to compute it here. |
| 197 target_visibility = ":$target_name" | 200 target_visibility = ":$target_name" |
| 198 | 201 |
| 199 # The current grit setup makes an file in $target_gen_dir/grit/foo.h that | 202 # The current grit setup makes an file in $target_gen_dir/grit/foo.h that |
| 200 # the source code expects to include via "grit/foo.h". It would be nice to | 203 # the source code expects to include via "grit/foo.h". It would be nice to |
| 201 # change this to including absolute paths relative to the root gen directory | 204 # change this to including absolute paths relative to the root gen directory |
| 202 # (like "mycomponent/foo.h"). This config sets up the include path. | 205 # (like "mycomponent/foo.h"). This config sets up the include path. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 direct_dependent_configs = [ ":$grit_config" ] | 241 direct_dependent_configs = [ ":$grit_config" ] |
| 239 | 242 |
| 240 if (defined(invoker.visibility)) { | 243 if (defined(invoker.visibility)) { |
| 241 visibility = invoker.visibility | 244 visibility = invoker.visibility |
| 242 } | 245 } |
| 243 if (defined(invoker.output_name)) { | 246 if (defined(invoker.output_name)) { |
| 244 output_name = invoker.output_name | 247 output_name = invoker.output_name |
| 245 } | 248 } |
| 246 } | 249 } |
| 247 } | 250 } |
| OLD | NEW |