summaryrefslogtreecommitdiffstats
path: root/chrome/version.gni
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-02-25 10:46:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-25 18:48:11 +0000
commit70d2f6ea98ae618b24a7c517570b74d20b92a7c7 (patch)
treed9710e84119b831e80d1e41e9513a5d8c2f7dfb1 /chrome/version.gni
parent830ccc4c45969c05684bb8e6919197706859d0ec (diff)
downloadchromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.zip
chromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.tar.gz
chromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.tar.bz2
Fix official build in GN
Changes process_version template. In GYP this is used in two ways and the GN version only supported one of these. This change also deletes an unnecessary fork of the template file, and fixes the dependencies for the extra files (previously they were just passed with "-f" and not added to the inputs of the target. Adds a cdm_adapter template which basically matches the GYP version. Uses this for the media clearkey adapter and the widevine one in the official build. Fixes for the crypto targets when compiling with the official build's checked-in sysroots. Review URL: https://codereview.chromium.org/949233003 Cr-Commit-Position: refs/heads/master@{#318083}
Diffstat (limited to 'chrome/version.gni')
-rw-r--r--chrome/version.gni64
1 files changed, 50 insertions, 14 deletions
diff --git a/chrome/version.gni b/chrome/version.gni
index cc8d96a..b956e9c 100644
--- a/chrome/version.gni
+++ b/chrome/version.gni
@@ -6,28 +6,48 @@
# an output file. This is used for generating various forms of files that
# incorporate the product name and version.
#
-# This template automatically includes VERSION, LASTCHANGE, and BRANDING,
+# This template automatically includes VERSION, LASTCHANGE, and BRANDING. It
+# automatically uses the template file .
+# GYP parameterizes this template file but all current invocations use this
+# same one. If in the future we need to set it, this should be added as an
+# optional argument.
+#
+# In GYP this is a rule that runs once per ".ver" file. In GN this just
+# processes one file per invocation of the template so you may have to have
+# multiple targets.
+#
+# You must specify either sources or a template_file, or both.
#
# Parameters:
-# source:
-# File name of source template file to read.
+# sources (optional):
+# List of file names to read. When converting a GYP target, this should
+# list the 'source' (see above) as well as any extra_variable_files.
#
# output:
-# File name of file to write.
+# File name of file to write. In GYP this is unspecified and it will
+# make up a file name for you based on the input name, and tack on
+# "_version.rc" to the end. But in GN you need to specify the full name.
+#
+# template_file (optional):
+# Template file to use (not a list). Defaults to
+# //chrome/app/chrome_version.rc.version if unspecified.
#
# extra_args (optional):
-# Extra arguments to pass to version.py.
+# Extra arguments to pass to version.py. Any "-f <filename>" args should
+# use sources instead.
#
# visibility (optional)
#
# Example:
# process_version("myversion") {
-# source = "myfile.h.in"
+# sources = [ "myfile.h.in" ]
# output = "$target_gen_dir/myfile.h"
# extra_args = ["-e", "FOO=42"]
+# extra_files = [ "foo/BRANDING" ]
# }
template("process_version") {
- assert(defined(invoker.source), "Source must be defined for $target_name")
+ assert(defined(invoker.sources) || defined(invoker.template_file),
+ "Either sources or template_file must be defined for $target_name")
assert(defined(invoker.output), "Output must be defined for $target_name")
action(target_name) {
@@ -43,33 +63,49 @@ template("process_version") {
} else {
branding_path = "//chrome/app/theme/chromium/BRANDING"
}
+ if (defined(invoker.template_file)) {
+ template_path = invoker.template_file
+ } else {
+ template_path = "//chrome/app/chrome_version.rc.version"
+ }
inputs = [
version_path,
- invoker.source,
lastchange_path,
branding_path,
+ template_path,
]
outputs = [
invoker.output,
]
- args = [
+ args = []
+
+ if (defined(invoker.sources)) {
+ inputs += invoker.sources
+ foreach(i, invoker.sources) {
+ args += [
+ "-f",
+ rebase_path(i, root_build_dir),
+ ]
+ }
+ }
+
+ args += [
"-f",
rebase_path(version_path, root_build_dir),
"-f",
rebase_path(branding_path, root_build_dir),
"-f",
rebase_path(lastchange_path, root_build_dir),
- "-i",
- rebase_path(invoker.source, root_build_dir),
- "-o",
- rebase_path(invoker.output, root_build_dir),
]
-
if (defined(invoker.extra_args)) {
args += invoker.extra_args
}
+ args += [
+ rebase_path(template_path, root_build_dir),
+ rebase_path(invoker.output, root_build_dir),
+ ]
}
}