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

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 212843007: Update .gn files to use new template syntax. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with new shas Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/linux/pkg_config.gni ('k') | tools/gn/bin/linux/gn.sha1 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/gcc_toolchain.gni
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index e1f8a8941c2f0d9b624e8b11004b76ab9767e188..7e66c168bb6a159ad1bb1895c8d13f8e91c00b83 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -16,6 +16,23 @@
# toolchain.)
template("gcc_toolchain") {
toolchain(target_name) {
+ assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
+ assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value")
+ assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
+ assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ld\" value")
+ assert(defined(invoker.toolchain_cpu_arch),
+ "gcc_toolchain() must specify a \"toolchain_cpu_arch\"")
+ assert(defined(invoker.toolchain_os),
+ "gcc_toolchain() must specify a \"toolchain_os\"")
+
+ # We can't do string interpolation ($ in strings) on things with dots in
+ # them. To allow us to use $cc below, for example, we create copies of
+ # these values in our scope.
+ cc = invoker.cc
+ cxx = invoker.cxx
+ ar = invoker.ar
+ ld = invoker.ld
+
# Make these apply to all tools below.
lib_prefix = "-l"
lib_dir_prefix="-L"
@@ -61,8 +78,8 @@ template("gcc_toolchain") {
# When invoking this toolchain not as the default one, these args will be
# passed to the build. They are ignored when this is the default toolchain.
toolchain_args() {
- cpu_arch = toolchain_cpu_arch
- os = toolchain_os
+ cpu_arch = invoker.toolchain_cpu_arch
+ os = invoker.toolchain_os
}
}
}
« no previous file with comments | « build/config/linux/pkg_config.gni ('k') | tools/gn/bin/linux/gn.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698