xref: /aosp_15_r20/external/cronet/components/nacl/features.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2017 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/gclient_args.gni")
6
7# The NaCl sandbox and toolchain currently only support x86-32, x86-64
8# and ARM32.
9#
10# The NaCl sandbox itself supports MIPS32, but the Clang toolchain
11# support for that is no longer up-to-date, so we don't include that
12# in the list of CPU architectures to enable NaCl on.
13#
14# NaCl is also supported on ARM64 Chrome OS, where the ARM32 NaCl
15# sandbox is used.
16# NaCl works on non-Chrome-OS ARM64 Linux, but we don't enable it by default in
17# that case.
18_cpu_is_supported =
19    target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm" ||
20    (target_cpu == "arm64" && target_os == "chromeos")
21
22declare_args() {
23  # Enables Native Client support.
24  #
25  # NaCl is only supported on ChromeOS.
26  enable_nacl = checkout_nacl && _cpu_is_supported && target_os == "chromeos"
27}
28
29assert(!enable_nacl || checkout_nacl)
30