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

Unified Diff: build/toolchain/cros/BUILD.gn

Issue 1983613002: Rework the way ChromiumOS toolchains will work in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unneeded TODO Created 4 years, 7 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 | « no previous file | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/cros/BUILD.gn
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn
index f313b4249f00522413f0ce51f43febd652cbd99a..10bcca43eec9a0fb644b7556e3d6445031b0f9ca 100644
--- a/build/toolchain/cros/BUILD.gn
+++ b/build/toolchain/cros/BUILD.gn
@@ -36,36 +36,112 @@ import("//build/toolchain/gcc_toolchain.gni")
declare_args() {
# These must be specified for a board-specific build.
- cros_target_cc = ""
- cros_target_cxx = ""
- cros_target_ar = ""
+ cros_target_ar = "ar"
+ cros_target_cc = "gcc"
+ cros_target_cxx = "g++"
+ cros_target_ld = ""
+
+ # These can be optionally set.
+ cros_target_extra_cflags = ""
+ cros_target_extra_cppflags = ""
+ cros_target_extra_cxxflags = ""
+ cros_target_extra_ldflags = ""
+
+ # is_clang is used instead of cros_target_is_clang
+
+ cros_host_ar = "ar"
+ cros_host_cc = "gcc"
+ cros_host_cxx = "g++"
+ cros_host_ld = ""
+ cros_host_extra_cflags = ""
+ cros_host_extra_cppflags = ""
brettw 2016/05/23 20:55:04 It would be nice if this had a similar comment as
Dirk Pranke 2016/05/23 20:59:15 yeah ... I waffled over how many comments I wanted
+ cros_host_extra_cxxflags = ""
+ cros_host_extra_ldflags = ""
+ cros_host_is_clang = false
+
+ cros_v8_snapshot_ar = "ar"
+ cros_v8_snapshot_cc = "gcc"
+ cros_v8_snapshot_cxx = "g++"
+ cros_v8_snapshot_ld = ""
+ cros_v8_snapshot_extra_cflags = ""
+ cros_v8_snapshot_extra_cppflags = ""
+ cros_v8_snapshot_extra_cxxflags = ""
+ cros_v8_snapshot_extra_ldflags = ""
+ cros_v8_snapshot_is_clang = false
}
+# TODO(dpranke): Delete this after we get rid of the reference to
+# build/toolchain/cros:clang_target in BUILDCONFIG.gn
clang_toolchain("clang_target") {
toolchain_cpu = target_cpu
toolchain_os = "linux"
}
gcc_toolchain("target") {
- # These defaults permit building on a Linux host as described above.
- cc = "gcc"
- cxx = "g++"
- ar = "ar"
-
- # But to build for a specific board, the cros_* args will need to be defined.
- if (cros_target_cc != "") {
- cc = "${cros_target_cc}"
- }
- if (cros_target_cxx != "") {
- cxx = "${cros_target_cxx}"
- }
- if (cros_target_ar != "") {
- ar = "${cros_target_ar}"
- }
+ # These are args for the template.
+ ar = cros_target_ar
+ cc = cros_target_cc
+ cxx = cros_target_cxx
ld = cxx
+ if (cros_target_ld != "") {
+ ld = cros_target_ld
+ }
+ extra_cflags = cros_target_extra_cflags
+ extra_cppflags = cros_target_extra_cppflags
+ extra_cxxflags = cros_target_extra_cxxflags
+ extra_ldflags = cros_target_extra_ldflags
+ # These are passed through as toolchain_args.
+ cc_wrapper = ""
+ is_clang = is_clang
toolchain_cpu = target_cpu
toolchain_os = "linux"
- is_clang = is_clang
+}
+
+gcc_toolchain("host") {
+ # These are args for the template.
+ ar = cros_host_ar
+ cc = cros_host_cc
+ cxx = cros_host_cxx
+ ld = cxx
+ if (cros_host_ld != "") {
+ ld = cros_host_ld
+ }
+ extra_cflags = cros_host_extra_cflags
+ extra_cppflags = cros_host_extra_cppflags
+ extra_cxxflags = cros_host_extra_cxxflags
+ extra_ldflags = cros_host_extra_ldflags
+
+ # These are passed through as toolchain_args.
cc_wrapper = ""
+ is_clang = cros_host_is_clang
+ toolchain_cpu = host_cpu
+ toolchain_os = "linux"
+ use_sysroot = false
+}
+
+gcc_toolchain("v8_snapshot") {
+ # These are args for the template.
+ ar = cros_v8_snapshot_ar
+ cc = cros_v8_snapshot_cc
+ cxx = cros_v8_snapshot_cxx
+ ld = cxx
+ if (cros_v8_snapshot_ld != "") {
+ ld = cros_v8_snapshot_ld
+ }
+ extra_cflags = cros_v8_snapshot_extra_cflags
+ extra_cppflags = cros_v8_snapshot_extra_cppflags
+ extra_cxxflags = cros_v8_snapshot_extra_cxxflags
+ extra_ldflags = cros_v8_snapshot_extra_ldflags
+
+ # These are passed through as toolchain_args.
+ cc_wrapper = ""
+ is_clang = cros_v8_snapshot_is_clang
+ if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") {
+ toolchain_cpu = "x86"
+ } else {
+ toolchain_cpu = "x64"
+ }
+ toolchain_os = "linux"
+ use_sysroot = false
}
« no previous file with comments | « no previous file | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698