| # Copyright 2016 The Chromium Authors. All rights reserved. |
| # 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/gclient_args.gni") |
| import("//chrome/android/channel.gni") |
| |
| declare_args() { |
| enable_gvr_services = is_android && !is_chromecast && |
| (current_cpu == "arm" || current_cpu == "arm64") |
| |
| enable_openvr = is_win |
| |
| enable_windows_mr = is_win |
| |
| # To build with Oculus support, the Oculus SDK for Windows will need to be |
| # installed in third_party/libovr/src. See |
| # third_party/libovr/README.chromium for details. |
| enable_oculus_vr = checkout_oculus_sdk && is_chrome_branded && 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_openvr || enable_oculus_vr || |
| enable_windows_mr || |
| (is_desktop_linux && (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 whether the ARCore SDK is packaged into the APK. |
| # It is not used for bundle builds. |
| # TODO(crbug.com/920424): Remove this variable once it is no longer necessary. |
| # TODO(crbug.com/843374): AR should not depend on |enable_vr|. |
| package_arcore = enable_vr && is_android && !is_chromecast && |
| (current_cpu == "arm" || current_cpu == "arm64") && |
| (android_channel == "default" || |
| android_channel == "canary" || android_channel == "dev") |
| |
| # 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_chromecast && |
| (current_cpu == "arm" || current_cpu == "arm64") |
| |
| # When enabled, host Desktop VR devices (OpenVR and Oculus) in a separate |
| # process. When disabled, and Oculus/OpenVR are enabled, they are hosted |
| # in the browser process. |
| enable_isolated_xr_service = |
| enable_oculus_vr || enable_openvr || enable_windows_mr |
| } |
| |
| declare_args() { |
| # Whether to create a VR/AR module when building bundles. If false, VR/AR code |
| # will become part of the base module. |
| modularize_vr = enable_vr |
| modularize_ar = enable_arcore |
| |
| # When true, portions of VR's native code are included in the VR DFM. |
| modularize_vr_native = false |
| } |
| |
| if (modularize_vr_native) { |
| assert(modularize_vr) |
| } |