| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 # output_name (optional) | 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) | |
| 67 # If set to false, output_dir is added to include_dirs. | |
| 68 # | |
| 69 # configs (optional) | 66 # configs (optional) |
| 70 # List of additional configs to be applied to the generated target. | 67 # List of additional configs to be applied to the generated target. |
| 71 # deps (optional) | 68 # deps (optional) |
| 72 # visibility (optional) | 69 # visibility (optional) |
| 73 # Normal meaning. | 70 # Normal meaning. |
| 74 # | 71 # |
| 75 # Example | 72 # Example |
| 76 # | 73 # |
| 77 # grit("my_resources") { | 74 # grit("my_resources") { |
| 78 # # Source and outputs are required. | 75 # # Source and outputs are required. |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 assert_files_flags += [ "--assert-file-list=" + | 335 assert_files_flags += [ "--assert-file-list=" + |
| 339 rebase_path(asserted_list_file, root_build_dir) ] | 336 rebase_path(asserted_list_file, root_build_dir) ] |
| 340 grit_outputs = | 337 grit_outputs = |
| 341 get_path_info(rebase_path(invoker.outputs, ".", output_dir), "abspath") | 338 get_path_info(rebase_path(invoker.outputs, ".", output_dir), "abspath") |
| 342 | 339 |
| 343 # The config and the action below get this visibility son only the generated | 340 # The config and the action below get this visibility son only the generated |
| 344 # source set can depend on them. The variable "target_name" will get | 341 # 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. | 342 # overwritten inside the inner classes so we need to compute it here. |
| 346 target_visibility = [ ":$target_name" ] | 343 target_visibility = [ ":$target_name" ] |
| 347 | 344 |
| 348 # The current grit setup makes an file in $output_dir/grit/foo.h that | 345 # This config sets up flags needed for enable_resource_whitelist_generation. |
| 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 | |
| 351 # (like "mycomponent/foo.h"). This config sets up the include path. | |
| 352 grit_config = target_name + "_grit_config" | 346 grit_config = target_name + "_grit_config" |
| 353 config(grit_config) { | 347 config(grit_config) { |
| 354 if (defined(invoker.use_qualified_include) && | |
| 355 !invoker.use_qualified_include) { | |
| 356 include_dirs = [ output_dir ] | |
| 357 } | |
| 358 | |
| 359 if ((is_linux || is_android) && enable_resource_whitelist_generation) { | 348 if ((is_linux || is_android) && enable_resource_whitelist_generation) { |
| 360 cflags = [ | 349 cflags = [ |
| 361 "-Wunknown-pragmas", | 350 "-Wunknown-pragmas", |
| 362 "-Wno-error=unknown-pragmas", | 351 "-Wno-error=unknown-pragmas", |
| 363 ] | 352 ] |
| 364 } | 353 } |
| 365 visibility = target_visibility | 354 visibility = target_visibility |
| 366 } | 355 } |
| 367 | 356 |
| 368 grit_custom_target = target_name + "_grit" | 357 grit_custom_target = target_name + "_grit" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 if (defined(invoker.configs)) { | 478 if (defined(invoker.configs)) { |
| 490 configs += invoker.configs | 479 configs += invoker.configs |
| 491 } | 480 } |
| 492 | 481 |
| 493 if (defined(invoker.visibility)) { | 482 if (defined(invoker.visibility)) { |
| 494 visibility = invoker.visibility | 483 visibility = invoker.visibility |
| 495 } | 484 } |
| 496 output_name = grit_output_name | 485 output_name = grit_output_name |
| 497 } | 486 } |
| 498 } | 487 } |
| OLD | NEW |