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 (required) | 10 # source (required) |
(...skipping 23 matching lines...) Expand all Loading... |
34 # List of strings containing extra command-line flags to pass to Grit. | 34 # List of strings containing extra command-line flags to pass to Grit. |
35 # | 35 # |
36 # resource_ids (optional) | 36 # resource_ids (optional) |
37 # Path to a grit "firstidsfile". Default is | 37 # Path to a grit "firstidsfile". Default is |
38 # //tools/gritsettings/resource_ids. Set to "" to use the value specified in | 38 # //tools/gritsettings/resource_ids. Set to "" to use the value specified in |
39 # the <grit> nodes of the processed files. | 39 # the <grit> nodes of the processed files. |
40 # | 40 # |
41 # output_dir (optional) | 41 # output_dir (optional) |
42 # Directory for generated files. | 42 # Directory for generated files. |
43 # | 43 # |
| 44 # use_qualified_include (optional) |
| 45 # If set, output_dir is not added to include_dirs. |
| 46 # |
44 # deps (optional) | 47 # deps (optional) |
45 # visibility (optional) | 48 # visibility (optional) |
46 # Normal meaning. | 49 # Normal meaning. |
47 # | 50 # |
48 # Example | 51 # Example |
49 # | 52 # |
50 # grit("my_resources") { | 53 # grit("my_resources") { |
51 # # Source and outputs are required. | 54 # # Source and outputs are required. |
52 # source = "myfile.grd" | 55 # source = "myfile.grd" |
53 # outputs = [ | 56 # outputs = [ |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 # source set can depend on them. The variable "target_name" will get | 243 # source set can depend on them. The variable "target_name" will get |
241 # overwritten inside the innter classes so we need to compute it here. | 244 # overwritten inside the innter classes so we need to compute it here. |
242 target_visibility = ":$target_name" | 245 target_visibility = ":$target_name" |
243 | 246 |
244 # The current grit setup makes an file in $output_dir/grit/foo.h that | 247 # The current grit setup makes an file in $output_dir/grit/foo.h that |
245 # the source code expects to include via "grit/foo.h". It would be nice to | 248 # the source code expects to include via "grit/foo.h". It would be nice to |
246 # change this to including absolute paths relative to the root gen directory | 249 # change this to including absolute paths relative to the root gen directory |
247 # (like "mycomponent/foo.h"). This config sets up the include path. | 250 # (like "mycomponent/foo.h"). This config sets up the include path. |
248 grit_config = target_name + "_grit_config" | 251 grit_config = target_name + "_grit_config" |
249 config(grit_config) { | 252 config(grit_config) { |
250 include_dirs = [ output_dir ] | 253 if (!defined(invoker.use_qualified_include) || |
| 254 !invoker.use_qualified_include) { |
| 255 include_dirs = [ output_dir ] |
| 256 } |
251 visibility = target_visibility | 257 visibility = target_visibility |
252 } | 258 } |
253 | 259 |
254 grit_custom_target = target_name + "_grit" | 260 grit_custom_target = target_name + "_grit" |
255 action(grit_custom_target) { | 261 action(grit_custom_target) { |
256 script = "//tools/grit/grit.py" | 262 script = "//tools/grit/grit.py" |
257 inputs = grit_inputs | 263 inputs = grit_inputs |
258 outputs = grit_outputs | 264 outputs = grit_outputs |
259 depfile = "$target_out_dir/${target_name}.d" | 265 depfile = "$target_out_dir/${target_name}.d" |
260 | 266 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 direct_dependent_configs = [ ":$grit_config" ] | 302 direct_dependent_configs = [ ":$grit_config" ] |
297 | 303 |
298 if (defined(invoker.visibility)) { | 304 if (defined(invoker.visibility)) { |
299 visibility = invoker.visibility | 305 visibility = invoker.visibility |
300 } | 306 } |
301 if (defined(invoker.output_name)) { | 307 if (defined(invoker.output_name)) { |
302 output_name = invoker.output_name | 308 output_name = invoker.output_name |
303 } | 309 } |
304 } | 310 } |
305 } | 311 } |
OLD | NEW |