• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# This file contains configs that need to be added or removed to all
6# SwiftShader libraries
7
8import("../swiftshader.gni")
9import("//build_overrides/build.gni")
10
11declare_args() {
12  # Subzero doesn't support ARM64, MIPS64, and PPC64 (only x86 and ARMv7a).
13  supports_subzero = current_cpu != "arm64" && current_cpu != "mips64el" && current_cpu != "ppc64"
14}
15
16declare_args() {
17  supports_llvm = is_linux || is_chromeos || is_fuchsia || is_win || is_android
18    # LLVM uses C++17 features which require macOS 10.12, while Chrome's minimum platform for x86 is 10.11.
19    # Don't build LLVM on Mac, unless we have to. This only happens on ARM64 devices, which launched with 11.0.
20    # TODO(b/174843857): Remove check for !supports_subzero once Chrome supports macOS 10.12
21    || (is_mac && !supports_subzero)
22}
23
24declare_args() {
25  # Subzero produces much smaller binaries, so always use it when available,
26  # except for MSan builds which only get Reactor code instrumented with LLVM.
27  use_swiftshader_with_subzero = supports_subzero && !is_msan
28}