diff --git a/BUILD.gn b/BUILD.gn index 83e44d7122..0641aa65de 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,8 +11,7 @@ if (is_android) { import("//build/config/android/rules.gni") } -# Because standalone V8 builds are not supported, assume this is part of a -# Chromium build. +import("gni/v8.gni") import("//build_overrides/v8.gni") import("snapshot_toolchain.gni") @@ -70,13 +69,15 @@ declare_args() { v8_random_seed = "314159265" v8_toolset_for_shell = "host" -if (is_msan) { - # Running the V8-generated code on an ARM simulator is a powerful hack that - # allows the tool to see the memory accesses from JITted code. Without this - # flag, JS code causes false positive reports from MSan. - v8_target_arch = "arm64" -} else { - v8_target_arch = target_cpu +if (v8_target_arch == "") { + if (is_msan) { + # Running the V8-generated code on an ARM simulator is a powerful hack that + # allows the tool to see the memory accesses from JITted code. Without this + # flag, JS code causes false positive reports from MSan. + v8_target_arch = "arm64" + } else { + v8_target_arch = target_cpu + } } if (v8_use_snapshot && v8_use_external_startup_data) { diff --git a/build_overrides/v8.gni b/build_overrides/v8.gni index af5cbc8511..719379d213 100644 --- a/build_overrides/v8.gni +++ b/build_overrides/v8.gni @@ -4,16 +4,12 @@ import("//build/config/features.gni") import("//build/config/ui.gni") +import("//gni/v8.gni") if (is_android) { import("//build/config/android/config.gni") } -declare_args() { - # V8 generates code for this architecture. - v8_target_arch = target_cpu -} - if (((v8_target_arch == "ia32" || v8_target_arch == "x64" || v8_target_arch=="x87") && diff --git a/gni/v8.gni b/gni/v8.gni new file mode 100644 index 0000000000..81fcfbfa7b --- /dev/null +++ b/gni/v8.gni @@ -0,0 +1,9 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # V8 generates code for this architecture. If v8_target_arch differs from + # target_cpu, a simulator will be run. + v8_target_arch = "" +}