| # This file introduces a templates for calling write_vcsrevision.py. |
| # header (required) [string] |
| # names (optional) [list of strings] |
| # Writes "$foo_REVISION" and "$foo_REPOSITORY" for each foo in names. |
| # If this is set to true, VCSRevision.h is updated after every git commit. |
| # That's technically correct, but results in rebuilds after every commit. |
| # If it's false (default), VCSRevision.h will not contain a revision. |
| llvm_append_vc_rev = false |
| template("write_vcsrevision") { |
| assert(defined(invoker.header), "must set 'header' in $target_name") |
| script = "//llvm/utils/gn/build/write_vcsrevision.py" |
| if (defined(invoker.names)) { |
| args = [ rebase_path(header, root_build_dir) ] |
| if (llvm_append_vc_rev) { |
| rebase_path(depfile, root_build_dir), |
| args += [ "--name=$name" ] |
| forward_variables_from(invoker, |