| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 !invoker.use_qualified_include) { | 357 !invoker.use_qualified_include) { |
| 358 include_dirs = [ output_dir ] | 358 include_dirs = [ output_dir ] |
| 359 } | 359 } |
| 360 visibility = target_visibility | 360 visibility = target_visibility |
| 361 } | 361 } |
| 362 | 362 |
| 363 grit_custom_target = target_name + "_grit" | 363 grit_custom_target = target_name + "_grit" |
| 364 action(grit_custom_target) { | 364 action(grit_custom_target) { |
| 365 script = "//tools/grit/grit.py" | 365 script = "//tools/grit/grit.py" |
| 366 inputs = grit_inputs | 366 inputs = grit_inputs |
| 367 outputs = grit_outputs | 367 |
| 368 depfile = "$output_dir/${grit_output_name}.d" | 368 # TODO(knn): Remove this once grit has rolled to recognize the flag. |
| 369 depend_on_stamp = |
| 370 defined(invoker.depend_on_stamp) && invoker.depend_on_stamp |
| 371 if (depend_on_stamp) { |
| 372 # Need this for migrating existing targets without clobbering. |
| 373 depfile = "$output_dir/${grit_output_name}_stamp.d" |
| 374 outputs = [ |
| 375 "${depfile}.stamp", |
| 376 ] |
| 377 } else { |
| 378 depfile = "$output_dir/${grit_output_name}.d" |
| 379 outputs = [] |
| 380 } |
| 381 outputs += grit_outputs |
| 369 | 382 |
| 370 args = [ | 383 args = [ |
| 371 "-i", | 384 "-i", |
| 372 source_path, | 385 source_path, |
| 373 "build", | 386 "build", |
| 374 ] | 387 ] |
| 375 if (resource_ids != "") { | 388 if (resource_ids != "") { |
| 376 args += [ | 389 args += [ |
| 377 "-f", | 390 "-f", |
| 378 resource_ids, | 391 resource_ids, |
| 379 ] | 392 ] |
| 380 } | 393 } |
| 381 args += [ | 394 args += [ |
| 382 "-o", | 395 "-o", |
| 383 rebased_output_dir, | 396 rebased_output_dir, |
| 384 "--depdir", | 397 "--depdir", |
| 385 ".", | 398 ".", |
| 386 "--depfile", | 399 "--depfile", |
| 387 rebase_path(depfile, root_build_dir), | 400 rebase_path(depfile, root_build_dir), |
| 388 "--write-only-new=1", | 401 "--write-only-new=1", |
| 389 ] + grit_defines | 402 ] |
| 403 if (depend_on_stamp) { |
| 404 args += [ "--depend-on-stamp" ] |
| 405 } |
| 406 args += grit_defines |
| 390 | 407 |
| 391 # Add extra defines with -D flags. | 408 # Add extra defines with -D flags. |
| 392 if (defined(invoker.defines)) { | 409 if (defined(invoker.defines)) { |
| 393 foreach(i, invoker.defines) { | 410 foreach(i, invoker.defines) { |
| 394 args += [ | 411 args += [ |
| 395 "-D", | 412 "-D", |
| 396 i, | 413 i, |
| 397 ] | 414 ] |
| 398 } | 415 } |
| 399 } | 416 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 if (defined(invoker.configs)) { | 460 if (defined(invoker.configs)) { |
| 444 configs += invoker.configs | 461 configs += invoker.configs |
| 445 } | 462 } |
| 446 | 463 |
| 447 if (defined(invoker.visibility)) { | 464 if (defined(invoker.visibility)) { |
| 448 visibility = invoker.visibility | 465 visibility = invoker.visibility |
| 449 } | 466 } |
| 450 output_name = grit_output_name | 467 output_name = grit_output_name |
| 451 } | 468 } |
| 452 } | 469 } |
| OLD | NEW |