1 # This file introduces a templates for calling write_vcsrevision.py.
5 # header (required) [string]
7 # names (optional) [list of strings]
8 # Writes "$foo_REVISION" and "$foo_REPOSITORY" for each foo in names.
9 # Defaults to [ "LLVM" ]
12 # If this is set to true, VCSRevision.h is updated after every git commit.
13 # That's technically correct, but results in rebuilds after every commit.
14 # If it's false (default), VCSRevision.h will not contain a revision.
15 llvm_append_vc_rev = false
18 template("write_vcsrevision") {
19 assert(defined(invoker.header), "must set 'header' in $target_name")
22 script = "//llvm/utils/gn/build/write_vcsrevision.py"
23 header = invoker.header
24 if (defined(invoker.names)) {
30 args = [ rebase_path(header, root_build_dir) ]
31 if (llvm_append_vc_rev) {
36 rebase_path(depfile, root_build_dir),
40 foreach(name, names) {
41 args += [ "--name=$name" ]
46 forward_variables_from(invoker,