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

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

Issue 2202873002: Rework approach to allowing extra flags for CrOS builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_cros_nacl_bootstrap_args
Patch Set: Created 4 years, 5 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
Index: build/toolchain/cros/BUILD.gn
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn
index 0149ce52f33c32a6e581006cf746fb67d00ecc53..397c7c2e25b55fe0361b5fb2242b681a16324928 100644
--- a/build/toolchain/cros/BUILD.gn
+++ b/build/toolchain/cros/BUILD.gn
@@ -22,10 +22,6 @@ gcc_toolchain("target") {
if (cros_target_readelf != "") {
readelf = cros_target_readelf
}
- 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 = ""
@@ -55,10 +51,6 @@ gcc_toolchain("nacl_bootstrap") {
if (cros_target_readelf != "") {
readelf = cros_target_readelf
}
- extra_cflags = cros_nacl_bootstrap_extra_cflags
- extra_cppflags = cros_nacl_bootstrap_extra_cppflags
- extra_cxxflags = cros_nacl_bootstrap_extra_cxxflags
- extra_ldflags = cros_nacl_bootstrap_extra_ldflags
# These are passed through as toolchain_args.
cc_wrapper = ""
@@ -85,10 +77,6 @@ gcc_toolchain("host") {
if (cros_host_readelf != "") {
readelf = cros_host_readelf
}
- 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 = ""
@@ -113,10 +101,6 @@ gcc_toolchain("v8_snapshot") {
if (cros_v8_snapshot_readelf != "") {
readelf = cros_v8_snapshot_readelf
}
- 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 = ""
@@ -130,3 +114,30 @@ gcc_toolchain("v8_snapshot") {
toolchain_os = "linux"
use_sysroot = false
}
+
+config("extra_flags") {
brettw 2016/08/03 23:02:14 This should really be in //build/config/cros/BUILD
Dirk Pranke 2016/08/03 23:09:07 Good point. I'll move it.
+ if (current_toolchain == "//build/toolchain/cros:target") {
+ cflags = cros_target_extra_cflags
+ cppflags = cros_target_extra_cppflags
+ cxxflags = cros_target_extra_cxxflags
+ ldflags = cros_target_extra_ldflags
+ } else if (current_toolchain == "//build/toolchain/cros:host") {
+ cflags = cros_host_extra_cflags
+ cppflags = cros_host_extra_cppflags
+ cxxflags = cros_host_extra_cxxflags
+ ldflags = cros_host_extra_ldflags
+ } else if (current_toolchain == "//build/toolchain/cros:v8_snapshot") {
+ cflags = cros_v8_snapshot_extra_cflags
+ cppflags = cros_v8_snapshot_extra_cppflags
+ cxxflags = cros_v8_snapshot_extra_cxxflags
+ ldflags = cros_v8_snapshot_extra_ldflags
+ } else if (current_toolchain == "//build/toolchain/cros:nacl_bootstrap") {
+ cflags = cros_nacl_bootstrap_extra_cflags
+ cppflags = cros_nacl_bootstrap_extra_cppflags
+ cxxflags = cros_nacl_bootstrap_extra_cxxflags
+ ldflags = cros_nacl_bootstrap_extra_ldflags
+ } else {
+ assert(false,
+ "Unexpected reference to this config from " + current_toolchain)
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698