Commit aba5ce45 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Restrict availability of libusb to macOS and Windows

On all other platforms //device/usb uses a custom backend. This patch
ensures that we are not including libusb in unexpected build
configurations.

Change-Id: Ia1b68e86048af7ed98d27b19f46f74ceba50097b
Reviewed-on: https://chromium-review.googlesource.com/996407Reviewed-by: default avatarJun Cai <juncai@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548282}
parent 0535a55b
...@@ -186,7 +186,6 @@ source_set("chromeos") { ...@@ -186,7 +186,6 @@ source_set("chromeos") {
"//third_party/cacheinvalidation", "//third_party/cacheinvalidation",
"//third_party/icu", "//third_party/icu",
"//third_party/leveldatabase", "//third_party/leveldatabase",
"//third_party/libusb",
"//third_party/protobuf:protobuf_lite", "//third_party/protobuf:protobuf_lite",
"//third_party/protobuf:protoc($host_toolchain)", "//third_party/protobuf:protoc($host_toolchain)",
"//third_party/re2", "//third_party/re2",
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
assert(!is_android && !is_ios) # libusb is only used by //device/usb on Windows and macOS.
assert(is_win || is_mac)
import("//build/config/features.gni") import("//build/config/features.gni")
...@@ -22,6 +23,10 @@ config("libusb_warnings") { ...@@ -22,6 +23,10 @@ config("libusb_warnings") {
} }
static_library("libusb") { static_library("libusb") {
visibility = [
"//device:device_unittests",
"//device/usb",
]
sources = [ sources = [
"src/config.h", "src/config.h",
"src/libusb/core.c", "src/libusb/core.c",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment