Fix Windows build
Change-Id: I682aef4007e1f7e0e801443aefcec5a7659f4753
diff --git a/libusb.BUILD b/libusb.BUILD
index 19d6984..e65b373 100644
--- a/libusb.BUILD
+++ b/libusb.BUILD
@@ -75,6 +75,10 @@
":libusb_config",
":libusb_headers",
],
+ linkopts = select({
+ "@platforms//os:windows": ["-DEFAULTLIB:AdvAPI32.Lib"],
+ "//conditions:default": [],
+ }),
)
label_flag(
@@ -108,8 +112,14 @@
cc_library(
name = "libusb_windows",
- srcs = glob(["libusb/os/*_windows.c"]),
- hdrs = glob(["libusb/os/*_windows.h"]),
+ srcs = glob([
+ "libusb/os/*_windows.c",
+ "libusb/os/windows_*.c",
+ ]),
+ hdrs = glob([
+ "libusb/os/*_windows.h",
+ "libusb/os/windows_*.h",
+ ]),
visibility = ["//visibility:private"],
deps = [
":libusb_config",