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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 # Path to a grit "firstidsfile". Default is | 46 # Path to a grit "firstidsfile". Default is |
47 # //tools/gritsettings/resource_ids. Set to "" to use the value specified | 47 # //tools/gritsettings/resource_ids. Set to "" to use the value specified |
48 # in the <grit> nodes of the processed files. | 48 # in the <grit> nodes of the processed files. |
49 # | 49 # |
50 # output_dir (optional) | 50 # output_dir (optional) |
51 # Directory for generated files. If you specify this, you will often | 51 # Directory for generated files. If you specify this, you will often |
52 # want to specify output_name if the target name is not particularly | 52 # want to specify output_name if the target name is not particularly |
53 # unique, since this can cause files from multiple grit targets to | 53 # unique, since this can cause files from multiple grit targets to |
54 # overwrite each other. | 54 # overwrite each other. |
55 # | 55 # |
56 # output_name (optiona) | 56 # output_name (optional) |
57 # Provide an alternate base name for the generated files, like the .d | 57 # Provide an alternate base name for the generated files, like the .d |
58 # files. Normally these are based on the target name and go in the | 58 # files. Normally these are based on the target name and go in the |
59 # output_dir, but if multiple targets with the same name end up in | 59 # output_dir, but if multiple targets with the same name end up in |
60 # the same output_dir, they can collide. | 60 # the same output_dir, they can collide. |
61 # | 61 # |
62 # depfile_dir (optional) | 62 # depfile_dir (optional) |
63 # If set, used to store the depfile and corresponding stamp file. | 63 # If set, used to store the depfile and corresponding stamp file. |
64 # Defaults to output_dir | 64 # Defaults to output_dir |
65 # | 65 # |
66 # use_qualified_include (optional) | 66 # use_qualified_include (optional) |
67 # If set, output_dir is not added to include_dirs. | 67 # If set to false, output_dir is added to include_dirs. |
68 # | 68 # |
69 # configs (optional) | 69 # configs (optional) |
70 # List of additional configs to be applied to the generated target. | 70 # List of additional configs to be applied to the generated target. |
71 # deps (optional) | 71 # deps (optional) |
72 # visibility (optional) | 72 # visibility (optional) |
73 # Normal meaning. | 73 # Normal meaning. |
74 # | 74 # |
75 # Example | 75 # Example |
76 # | 76 # |
77 # grit("my_resources") { | 77 # grit("my_resources") { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 # source set can depend on them. The variable "target_name" will get | 344 # source set can depend on them. The variable "target_name" will get |
345 # overwritten inside the inner classes so we need to compute it here. | 345 # overwritten inside the inner classes so we need to compute it here. |
346 target_visibility = [ ":$target_name" ] | 346 target_visibility = [ ":$target_name" ] |
347 | 347 |
348 # The current grit setup makes an file in $output_dir/grit/foo.h that | 348 # The current grit setup makes an file in $output_dir/grit/foo.h that |
349 # the source code expects to include via "grit/foo.h". It would be nice to | 349 # the source code expects to include via "grit/foo.h". It would be nice to |
350 # change this to including absolute paths relative to the root gen directory | 350 # change this to including absolute paths relative to the root gen directory |
351 # (like "mycomponent/foo.h"). This config sets up the include path. | 351 # (like "mycomponent/foo.h"). This config sets up the include path. |
352 grit_config = target_name + "_grit_config" | 352 grit_config = target_name + "_grit_config" |
353 config(grit_config) { | 353 config(grit_config) { |
354 if (!defined(invoker.use_qualified_include) || | 354 if (defined(invoker.use_qualified_include) && |
355 !invoker.use_qualified_include) { | 355 !invoker.use_qualified_include) { |
356 include_dirs = [ output_dir ] | 356 include_dirs = [ output_dir ] |
357 } | 357 } |
358 | 358 |
359 if ((is_linux || is_android) && enable_resource_whitelist_generation) { | 359 if ((is_linux || is_android) && enable_resource_whitelist_generation) { |
360 cflags = [ | 360 cflags = [ |
361 "-Wunknown-pragmas", | 361 "-Wunknown-pragmas", |
362 "-Wno-error=unknown-pragmas", | 362 "-Wno-error=unknown-pragmas", |
363 ] | 363 ] |
364 } | 364 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (defined(invoker.configs)) { | 489 if (defined(invoker.configs)) { |
490 configs += invoker.configs | 490 configs += invoker.configs |
491 } | 491 } |
492 | 492 |
493 if (defined(invoker.visibility)) { | 493 if (defined(invoker.visibility)) { |
494 visibility = invoker.visibility | 494 visibility = invoker.visibility |
495 } | 495 } |
496 output_name = grit_output_name | 496 output_name = grit_output_name |
497 } | 497 } |
498 } | 498 } |
OLD | NEW |