1 # Copyright 2016 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/chrome_build.gni")
6 import("//build/util/lastchange.gni")
7 import("//build/util/process_version.gni")
9 # This is a wrapper around process_version() that eases the task of processing
10 # a .rc.version file (used especially on Windows).
12 # This template automatically includes VERSION, LASTCHANGE and BRANDING, and
13 # any additional source files are passed after those (so their values can
14 # override the ones specified by those 3 files).
18 # List of files with value definitions that will be passed in addition to
19 # VERSION, LASTCHANGE and BRANDING.
21 # template_file (optional):
22 # Template file to use (not a list). If not specified, a default value,
23 # //chrome/app/chrome_version.rc.version will be used.
25 # This template forwards all other parameters directly to process_version().
28 # process_version_rc_template("my_exe_version") {
29 # output = "$target_gen_dir/my_exe_version.rc"
30 # sources = [ "frob/my_exe.ver" ]
31 # extra_args = [ "-e", "FOO=42" ]
34 # process_version_rc_template("my_dll_version") {
35 # output = "$target_gen_dir/my_dll_version.rc"
36 # template_file = [ "//foo/bar/my_dll_version.rc.version" ]
38 template("process_version_rc_template") {
39 if (defined(invoker.template_file)) {
40 _template_file = invoker.template_file
42 _template_file = "//chrome/app/chrome_version.rc.version"
49 if (defined(invoker.sources)) {
50 _sources += invoker.sources
53 process_version(target_name) {
54 template_file = _template_file
56 forward_variables_from(invoker,