Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: build/secondary/tools/grit/grit_rule.gni

Issue 1005763003: Allow for GN Grit targets to depend on a stamp file instead of the first output in the .grd file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 depend_on_stamp =
cjhopman 2015/03/14 00:37:45 Do we need to support not depending on a stamp?
knn 2015/03/16 10:53:42 This only so that the build does not break due to
cjhopman 2015/03/16 20:13:46 But, we can't set depend_on_stamp for any target u
368 depfile = "$output_dir/${grit_output_name}.d" 368 defined(invoker.depend_on_stamp) && invoker.depend_on_stamp
369 if (depend_on_stamp) {
370 # Need this for migrating existing targets without clobbering.
371 depfile = "$output_dir/${grit_output_name}_stamp.d"
372 outputs = [
373 "${depfile}.stamp",
374 ]
375 } else {
376 depfile = "$output_dir/${grit_output_name}.d"
377 outputs = []
378 }
379 outputs += grit_outputs
369 380
370 args = [ 381 args = [
371 "-i", 382 "-i",
372 source_path, 383 source_path,
373 "build", 384 "build",
374 ] 385 ]
375 if (resource_ids != "") { 386 if (resource_ids != "") {
376 args += [ 387 args += [
377 "-f", 388 "-f",
378 resource_ids, 389 resource_ids,
379 ] 390 ]
380 } 391 }
381 args += [ 392 args += [
382 "-o", 393 "-o",
383 rebased_output_dir, 394 rebased_output_dir,
384 "--depdir", 395 "--depdir",
385 ".", 396 ".",
386 "--depfile", 397 "--depfile",
387 rebase_path(depfile, root_build_dir), 398 rebase_path(depfile, root_build_dir),
388 "--write-only-new=1", 399 "--write-only-new=1",
389 ] + grit_defines 400 ]
401 if (depend_on_stamp) {
402 args += [ "--depend-on-stamp" ]
403 }
404 args += grit_defines
390 405
391 # Add extra defines with -D flags. 406 # Add extra defines with -D flags.
392 if (defined(invoker.defines)) { 407 if (defined(invoker.defines)) {
393 foreach(i, invoker.defines) { 408 foreach(i, invoker.defines) {
394 args += [ 409 args += [
395 "-D", 410 "-D",
396 i, 411 i,
397 ] 412 ]
398 } 413 }
399 } 414 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (defined(invoker.configs)) { 458 if (defined(invoker.configs)) {
444 configs += invoker.configs 459 configs += invoker.configs
445 } 460 }
446 461
447 if (defined(invoker.visibility)) { 462 if (defined(invoker.visibility)) {
448 visibility = invoker.visibility 463 visibility = invoker.visibility
449 } 464 }
450 output_name = grit_output_name 465 output_name = grit_output_name
451 } 466 }
452 } 467 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698