Index: device/vr/BUILD.gn |
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn |
index 5e321fd60d46f746322fbe6844ce7eb4754ebe3c..1420d6e6ecb2328a24967e4d07a9082c89d65f72 100644 |
--- a/device/vr/BUILD.gn |
+++ b/device/vr/BUILD.gn |
@@ -9,7 +9,7 @@ if (is_android) { |
import("//build/config/android/rules.gni") # For generate_jni(). |
} |
-if (current_cpu == "arm" || current_cpu == "arm64") { |
+if (enable_webvr) { |
component("vr") { |
output_name = "device_vr" |
@@ -21,6 +21,7 @@ if (current_cpu == "arm" || current_cpu == "arm64") { |
"vr_device_provider.h", |
"vr_display_impl.cc", |
"vr_display_impl.h", |
+ "vr_export.h", |
"vr_service_impl.cc", |
"vr_service_impl.h", |
] |
@@ -33,8 +34,7 @@ if (current_cpu == "arm" || current_cpu == "arm64") { |
] |
defines = [ "DEVICE_VR_IMPLEMENTATION" ] |
- |
- if (is_android) { |
+ if (is_android && (current_cpu == "arm" || current_cpu == "arm64")) { |
sources += [ |
"android/gvr/gvr_delegate.cc", |
"android/gvr/gvr_delegate.h", |
@@ -77,10 +77,31 @@ if (current_cpu == "arm" || current_cpu == "arm64") { |
"//mojo/public/cpp/bindings", |
] |
} |
+} else { |
+ component("mojo_only") { |
+ sources = [ |
+ # We need to include an empty .cc file so that mac and windows don't fall over when trying to |
+ # compile this. |
+ "empty.cc", |
+ "vr_export.h", |
+ ] |
+ defines = [ "DEVICE_VR_IMPLEMENTATION" ] |
+ public_deps = [ |
+ ":mojo_bindings", |
+ ] |
+ } |
} |
mojom("mojo_bindings") { |
sources = [ |
"vr_service.mojom", |
] |
+ |
+ public_deps = [ |
+ "//mojo/common:common_custom_types", |
+ ] |
+ |
+ export_class_attribute = "DEVICE_VR_EXPORT" |
+ export_define = "DEVICE_VR_IMPLEMENTATION=1" |
+ export_header = "device/vr/vr_export.h" |
} |