build: disable libusb logging by default

It is quite verbose and not very useful.
This commit is contained in:
2024-07-11 22:14:20 -07:00
parent eb7ad4ef9e
commit 4777d04594
4 changed files with 78 additions and 12 deletions

16
deps/libusb/build.zig vendored
View File

@@ -10,6 +10,18 @@ pub fn build(b: *std.Build) !void {
"link and use udev (Linux only. Default: false)",
) orelse false;
const enable_logging = b.option(
bool,
"enable_logging",
"enable libusb's built-in logging (Default: false)",
) orelse false;
const enable_debug_logging = b.option(
bool,
"enable_debug_logging",
"enable libusb's debug logging (Default: false)",
) orelse false;
const libusb = b.addStaticLibrary(.{
.name = "usb",
.target = target,
@@ -59,8 +71,8 @@ pub fn build(b: *std.Build) !void {
.{ .style = .{ .autoconf = b.path("config.h.in") } },
.{
.DEFAULT_VISIBILITY = .@"__attribute__ ((visibility (\"default\")))",
.ENABLE_DEBUG_LOGGING = oneOrNull(optimize == .Debug),
.ENABLE_LOGGING = oneOrNull(optimize == .Debug),
.ENABLE_DEBUG_LOGGING = oneOrNull(enable_debug_logging),
.ENABLE_LOGGING = oneOrNull(enable_logging),
.HAVE_ASM_TYPES_H = null,
.HAVE_CLOCK_GETTIME = oneOrNull(linux_target),
.HAVE_DECL_EFD_CLOEXEC = oneOrNull(linux_target),