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) |
+ } |
+} |