# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/gclient_args.gni")

declare_args() {
  enable_gvr_services = is_android && !is_cast_android &&
                        (current_cpu == "arm" || current_cpu == "arm64")

  enable_cardboard = false

  use_command_buffer = is_win

  # To build with OpenXR support, the OpenXR Loader needs to be pulled to
  # third_party/openxr.
  enable_openxr = checkout_openxr && is_win
}

declare_args() {
  # Enable VR device support whenever VR device SDK(s) are supported.
  # We enable VR on Linux even though VR features aren't usable because
  # the binary size impact is small and allows many VR tests to run on Linux
  enable_vr =
      enable_gvr_services || enable_openxr ||
      (is_linux && !is_castos && (current_cpu == "x64" || current_cpu == "x86"))

  # Whether to include VR extras like test APKs in non-VR-specific targets
  include_vr_data = false
}

declare_args() {
  # Controls inclusion of code for ARCore that must be identical across configs.
  # Once crbug.com/920424 is resolved, this will exactly control whether ARCore
  # is supported.
  # TODO(crbug.com/843374): AR should not depend on |enable_vr|.
  enable_arcore = enable_vr && is_android && !is_cast_android &&
                  (current_cpu == "arm" || current_cpu == "arm64")
}