Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index c2f9aff2757a915d06b56aa04890bbb7d944a2fd..5ea23c5ef3e1e05ceda1aea8df2c1505c23e4853 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -6,7 +6,6 @@ import("//build/config/android/config.gni") |
import("//build/config/chrome_build.gni") |
import("//build/config/chromecast_build.gni") |
import("//build/config/compiler/compiler.gni") |
-import("//build/config/nacl/config.gni") |
import("//build/toolchain/cc_wrapper.gni") |
import("//build/toolchain/toolchain.gni") |
import("//build_overrides/build.gni") |
@@ -23,6 +22,12 @@ if (is_mac) { |
if (is_ios) { |
import("//build/config/ios/ios_sdk.gni") |
} |
+if (is_nacl) { |
+ # To keep NaCl variables out of builds that don't include NaCl, all |
+ # variables defined in nacl/config.gni referenced here should be protected by |
+ # is_nacl conditions. |
+ import("//build/config/nacl/config.gni") |
+} |
declare_args() { |
# Default to warnings as errors for default workflow, where we catch |
@@ -1494,7 +1499,7 @@ config("no_optimize") { |
# optimization and link-time code generation which is very expensive and should |
# be used sparingly. |
config("optimize_max") { |
- if (is_nacl_irt) { |
+ if (is_nacl && is_nacl_irt) { |
# The NaCl IRT is a special case and always wants its own config. |
# Various components do: |
# if (!is_debug) { |
@@ -1541,7 +1546,7 @@ config("optimize_max") { |
# TODO(crbug.com/621335) - rework how all of these configs are related |
# so that we don't need this disclaimer. |
config("optimize_speed") { |
- if (is_nacl_irt) { |
+ if (is_nacl && is_nacl_irt) { |
# The NaCl IRT is a special case and always wants its own config. |
# Various components do: |
# if (!is_debug) { |
@@ -1587,7 +1592,7 @@ config("optimize_fuzzing") { |
# The default optimization applied to all targets. This will be equivalent to |
# either "optimize" or "no_optimize", depending on the build flags. |
config("default_optimization") { |
- if (is_nacl_irt) { |
+ if (is_nacl && is_nacl_irt) { |
# The NaCl IRT is a special case and always wants its own config. |
# It gets optimized the same way regardless of the type of build. |
configs = [ "//build/config/nacl:irt_optimize" ] |