commit | ef9da265d5a79d45bc1327038b58ff84e62adabf | [log] [tgz] |
---|---|---|
author | Armando Montanez <amontanez@google.com> | Tue Jun 04 19:05:08 2024 -0700 |
committer | Armando Montanez <amontanez@google.com> | Tue Jun 04 19:08:38 2024 -0700 |
tree | 828e350795fa99946976c59f3c4705113da5ccd0 | |
parent | d1048e64d75aed3be48861f5b9ba8b097e344813 [diff] |
Tidy up naming/organization Cleans up naming to be more ergonomic and obvious. Change-Id: I16a4ebfd833eec66a1057dd40f8836b7e7b7c721
A small wrapper Bazel module that builds libusb from sources. Supports Windows, macOS, and Linux.
At this time, rules_libusb only supports bzlmod projects. Legacy WORKSPACE
projects are not explicitly supported.
Add rules_libusb to your MODULE.bazel
file:
bazel_dep(name = "rules_libusb", version="0.1.0-rc1") libusb = use_extension("@rules_libusb//:extensions.bzl", "libusb") # Versioning constraints are optional. libusb.source_release(min_version = "1.0.27") use_repo(libusb, "libusb")
Then add to the tool that requires libusb:
cc_binary( name = "my_tool", srcs = ["main.cpp"], deps = ["@libusb//:libusb_core"], # Required for headers. dynamic_deps = ["@libusb//:libusb"], # Link against shared lib. )
Note: source_release
constraints follow bzlmod behavior of minimal version selection.
To build this repo, run:
bazel build @libusb//:libusb