Skip to content

Commit

Permalink
Build safe-ftdi with bazel.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed May 11, 2022
1 parent 861cb8e commit 1ee6fb4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
32 changes: 32 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load(
"@rules_rust//rust:defs.bzl",
"rust_library",
)

package(default_visibility = ["//visibility:public"])

licenses([
"notice", # MIT from expression "MIT"
])

rust_library(
name = "safe_ftdi",
srcs = glob(["src/*.rs"]),
aliases = {
},
crate_features = [
"default",
],
crate_root = "src/lib.rs",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"crate-name=safe-ftdi",
],
deps = [
"//third_party/rust/crates:libftdi1_sys",
],
)
3 changes: 3 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ workspace(name = "com_github_safe_ftdi")

# Rust Toolchain + crates.io Dependencies
load("//third_party/rust:repos.bzl", "rust_repos")

rust_repos()

load("//third_party/rust:deps.bzl", "rust_deps")

rust_deps()
5 changes: 4 additions & 1 deletion third_party/rust/deps.bzl
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
load("@rules_rust//rust:repositories.bzl", "rust_repositories")
load("//third_party/rust/crates:crates.bzl", "raze_fetch_remote_crates")

def fetch_remote_crates():
raze_fetch_remote_crates()

def rust_deps():
rust_repositories(
edition = "2018",
version = "1.58.0",
)
raze_fetch_remote_crates()
fetch_remote_crates()

0 comments on commit 1ee6fb4

Please sign in to comment.