Skip to content

Commit

Permalink
Move vr features.gni into its own directory.
Browse files Browse the repository at this point in the history
This fixes some weird issues we were encountering, where we had to hide some build targets behind (!is_ios) after adding our features target to ui/gfx.
I'm not sure if any extra code was being compiled in, but asserts in gn files were being hit related to things that shouldn't be included on ios.
It seems other features have already done this sort of thing.

TBR=brettw@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2840563004
Cr-Commit-Position: refs/heads/master@{#467113}
Committed: https://chromium.googlesource.com/chromium/src/+/faae24707ba8852ea92b56bcf77aa19878aacdab
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2840563004
Cr-Commit-Position: refs/heads/master@{#467167}
  • Loading branch information
mthiesse authored and Commit bot committed Apr 25, 2017
1 parent faaae32 commit 4cb2891
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 46 deletions.
2 changes: 1 addition & 1 deletion chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import("//chrome/android/monochrome_android_manifest_jinja_variables.gni")
import("//chrome/chrome_paks.gni")
import("//chrome/common/features.gni")
import("//chrome/process_version_rc_template.gni") # For branding_file_path.
import("//device/vr/features.gni")
import("//device/vr/features/features.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import("//build/split_static_library.gni")
import("//chrome/common/features.gni")
import("//components/os_crypt/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//device/vr/features.gni")
import("//device/vr/features/features.gni")
import("//extensions/features/features.gni")
import("//media/media_options.gni")
import("//net/features.gni")
Expand Down Expand Up @@ -1608,7 +1608,7 @@ split_static_library("browser") {
"//device/power_save_blocker",
"//device/usb/mojo",
"//device/usb/public/interfaces",
"//device/vr:features",
"//device/vr/features",
"//extensions/features",
"//gin:gin_features",
"//google_apis",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include_rules = [
"+device/media_transfer_protocol",
"+device/power_save_blocker",
"+device/usb",
"+device/vr/features.h",
"+device/vr/features/features.h",
"+extensions/browser",
"+extensions/common",
"+extensions/components/javascript_dialog_extensions_client",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#include "content/public/common/feature_h264_with_openh264_ffmpeg.h"
#include "content/public/common/features.h"
#include "device/base/features.h"
#include "device/vr/features.h"
#include "device/vr/features/features.h"
#include "extensions/features/features.h"
#include "gin/public/gin_features.h"
#include "gpu/config/gpu_switches.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include_rules = [
"+components/sync/test/fake_server/android",
"+components/toolbar",
"+components/web_contents_delegate_android",
"+device/vr/features.h",
"+device/vr/features/features.h",
"+sandbox/linux/seccomp-bpf/sandbox_bpf.h",
"+sandbox/sandbox_features.h",
"+third_party/gvr-android-sdk",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/chrome_jni_registrar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
#include "components/url_formatter/android/component_jni_registrar.h"
#include "components/variations/android/component_jni_registrar.h"
#include "components/web_contents_delegate_android/component_jni_registrar.h"
#include "device/vr/features.h"
#include "device/vr/features/features.h"
#include "printing/features/features.h"

#if BUILDFLAG(ENABLE_PRINTING) && !BUILDFLAG(ENABLE_PRINT_PREVIEW)
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/vr_shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/android/rules.gni")
import("//chrome/common/features.gni")
import("//device/vr/features.gni")
import("//device/vr/features/features.gni")
import("//testing/test.gni")

assert(enable_vr)
Expand Down
2 changes: 1 addition & 1 deletion chrome/common/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include_rules = [
"+components/translate/core/common",
"+components/url_formatter",
"+components/version_info",
"+device/vr/features.h",
"+device/vr/features/features.h",
"+extensions/common",
"+extensions/features",
"+gin/public", # For profiling.cc
Expand Down
2 changes: 1 addition & 1 deletion chrome/common/features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/features.gni")
import("//device/vr/features.gni")
import("//device/vr/features/features.gni")
import("//extensions/features/features.gni")
import("//media/media_options.gni")
import("//net/features.gni")
Expand Down
2 changes: 1 addition & 1 deletion content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ source_set("browser") {
"//device/power_save_blocker",
"//device/screen_orientation/public/interfaces",
"//device/vr",
"//device/vr:features",
"//device/vr/features",
"//device/wake_lock/public/interfaces",
"//google_apis",
"//gpu",
Expand Down
2 changes: 1 addition & 1 deletion content/browser/frame_host/render_frame_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/url_utils.h"
#include "device/geolocation/geolocation_service_context.h"
#include "device/vr/features.h"
#include "device/vr/features/features.h"
#include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
#include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
#include "media/base/media_switches.h"
Expand Down
2 changes: 1 addition & 1 deletion device/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("vr/features.gni")
import("vr/features/features.gni")
import("//build/config/features.gni")
import("//testing/test.gni")

Expand Down
42 changes: 14 additions & 28 deletions device/vr/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("features.gni")
import("//build/buildflag_header.gni")
import("features/features.gni")
import("//mojo/public/tools/bindings/mojom.gni")

if (is_android) {
import("//build/config/android/rules.gni") # For generate_jni().
}

# Generate a buildflag header for compile-time checking of WebVR support.
buildflag_header("features") {
header = "features.h"
flags = [
"ENABLE_VR=$enable_vr",
"ENABLE_OPENVR=$enable_openvr",
]
}

component("vr") {
output_name = "device_vr"

Expand All @@ -27,11 +17,9 @@ component("vr") {
]
defines = [ "DEVICE_VR_IMPLEMENTATION" ]
deps = [
":features",
":mojo_bindings",
"features",
]
if (!is_ios) {
deps += [ ":mojo_bindings" ]
}

if (!enable_vr) {
sources += [
Expand Down Expand Up @@ -128,19 +116,17 @@ if (enable_vr) {
}
}

if (!is_ios) {
mojom("mojo_bindings") {
sources = [
"vr_service.mojom",
]
mojom("mojo_bindings") {
sources = [
"vr_service.mojom",
]

public_deps = [
"//gpu/ipc/common:interfaces",
"//mojo/common:common_custom_types",
]
public_deps = [
"//gpu/ipc/common:interfaces",
"//mojo/common:common_custom_types",
]

export_class_attribute = "DEVICE_VR_EXPORT"
export_define = "DEVICE_VR_IMPLEMENTATION=1"
export_header = "device/vr/vr_export.h"
}
export_class_attribute = "DEVICE_VR_EXPORT"
export_define = "DEVICE_VR_IMPLEMENTATION=1"
export_header = "device/vr/vr_export.h"
}
15 changes: 15 additions & 0 deletions device/vr/features/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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("features.gni")
import("//build/buildflag_header.gni")

# Generate a buildflag header for compile-time checking of WebVR support.
buildflag_header("features") {
header = "features.h"
flags = [
"ENABLE_VR=$enable_vr",
"ENABLE_OPENVR=$enable_openvr",
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion device/vr/vr_device_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "build/build_config.h"
#include "device/vr/features.h"
#include "device/vr/features/features.h"

#if defined(OS_ANDROID)
#include "device/vr/android/gvr/gvr_device_provider.h"
Expand Down
4 changes: 2 additions & 2 deletions ui/gfx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# found in the LICENSE file.

import("//build/config/ui.gni")
import("//device/vr/features.gni")
import("//device/vr/features/features.gni")
import("//testing/test.gni")
import("//testing/libfuzzer/fuzzer_test.gni")

Expand Down Expand Up @@ -255,7 +255,7 @@ component("gfx") {
"//base:base_static",
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//device/vr:features",
"//device/vr/features",
"//skia",
"//third_party/zlib",
]
Expand Down
2 changes: 1 addition & 1 deletion ui/gfx/DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include_rules = [
"+base",
"+cc/paint",
"+device/vr/features.h",
"+device/vr/features/features.h",
"+skia/ext",
"+third_party/harfbuzz-ng",
"+third_party/skia",
Expand Down
2 changes: 1 addition & 1 deletion ui/gfx/font_render_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <vector>

#include "build/build_config.h"
#include "device/vr/features.h"
#include "device/vr/features/features.h"
#include "third_party/skia/include/core/SkFontLCDConfig.h"
#include "ui/gfx/font.h"
#include "ui/gfx/gfx_export.h"
Expand Down

0 comments on commit 4cb2891

Please sign in to comment.