| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 # output_name (optiona) | 47 # output_name (optiona) |
| 48 # Provide an alternate base name for the generated files, like the .d | 48 # Provide an alternate base name for the generated files, like the .d |
| 49 # files. Normally these are based on the target name and go in the | 49 # files. Normally these are based on the target name and go in the |
| 50 # output_dir, but if multiple targets with the same name end up in | 50 # output_dir, but if multiple targets with the same name end up in |
| 51 # the same output_dir, they can collide. | 51 # the same output_dir, they can collide. |
| 52 # | 52 # |
| 53 # use_qualified_include (optional) | 53 # use_qualified_include (optional) |
| 54 # If set, output_dir is not added to include_dirs. | 54 # If set, output_dir is not added to include_dirs. |
| 55 # | 55 # |
| 56 # deps (optional) | 56 # deps (optional) |
| 57 # data_deps (optional) | |
| 58 # visibility (optional) | 57 # visibility (optional) |
| 59 # Normal meaning. | 58 # Normal meaning. |
| 60 # | 59 # |
| 61 # Example | 60 # Example |
| 62 # | 61 # |
| 63 # grit("my_resources") { | 62 # grit("my_resources") { |
| 64 # # Source and outputs are required. | 63 # # Source and outputs are required. |
| 65 # source = "myfile.grd" | 64 # source = "myfile.grd" |
| 66 # outputs = [ | 65 # outputs = [ |
| 67 # "foo_strings.h", | 66 # "foo_strings.h", |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 # we want to keep the public "no visibility specified" default. | 406 # we want to keep the public "no visibility specified" default. |
| 408 visibility = target_visibility + invoker.visibility | 407 visibility = target_visibility + invoker.visibility |
| 409 } | 408 } |
| 410 | 409 |
| 411 deps = [ | 410 deps = [ |
| 412 "//tools/grit:grit_sources", | 411 "//tools/grit:grit_sources", |
| 413 ] | 412 ] |
| 414 if (defined(invoker.deps)) { | 413 if (defined(invoker.deps)) { |
| 415 deps += invoker.deps | 414 deps += invoker.deps |
| 416 } | 415 } |
| 417 if (defined(invoker.data_deps)) { | |
| 418 data_deps = invoker.data_deps | |
| 419 } | |
| 420 } | 416 } |
| 421 | 417 |
| 422 # This is the thing that people actually link with, it must be named the | 418 # This is the thing that people actually link with, it must be named the |
| 423 # same as the argument the template was invoked with. | 419 # same as the argument the template was invoked with. |
| 424 source_set(target_name) { | 420 source_set(target_name) { |
| 425 # Since we generate a file, we need to be run before the targets that | 421 # Since we generate a file, we need to be run before the targets that |
| 426 # depend on us. | 422 # depend on us. |
| 427 sources = grit_outputs | 423 sources = grit_outputs |
| 428 | 424 |
| 429 # Deps set on the template invocation will go on the grit script running | 425 # Deps set on the template invocation will go on the grit script running |
| 430 # target rather than this library. | 426 # target rather than this library. |
| 431 deps = [ | 427 deps = [ |
| 432 ":$grit_custom_target", | 428 ":$grit_custom_target", |
| 433 ] | 429 ] |
| 434 public_configs = [ ":$grit_config" ] | 430 public_configs = [ ":$grit_config" ] |
| 435 | 431 |
| 436 if (defined(invoker.public_configs)) { | 432 if (defined(invoker.public_configs)) { |
| 437 public_configs += invoker.public_configs | 433 public_configs += invoker.public_configs |
| 438 } | 434 } |
| 439 | 435 |
| 440 if (defined(invoker.visibility)) { | 436 if (defined(invoker.visibility)) { |
| 441 visibility = invoker.visibility | 437 visibility = invoker.visibility |
| 442 } | 438 } |
| 443 output_name = grit_output_name | 439 output_name = grit_output_name |
| 444 } | 440 } |
| 445 } | 441 } |
| OLD | NEW |