-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dom Rodriguez <[email protected]>
- Loading branch information
Showing
4 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
find_program(CXXBRIDGE cxxbridge PATHS "$ENV{HOME}/.cargo/bin/") | ||
if (CXXBRIDGE STREQUAL "CXXBRIDGE-NOTFOUND") | ||
find_program(CARGO cargo PATHS "$ENV{HOME}/.cargo/bin/") | ||
if (CARGO STREQUAL "CARGO-NOTFOUND") | ||
message(FATAL_ERROR "Requires cargo available in path, install via rustup https://rustup.rs/") | ||
endif() | ||
message("Could not find cxxbridge, trying to install with `cargo install cxxbridge-cmd'") | ||
execute_process(COMMAND ${CARGO} install cxxbridge-cmd) | ||
find_program(CXXBRIDGE cxxbridge PATHS "$ENV{HOME}/.cargo/bin/") | ||
endif() | ||
|
||
corrosion_import_crate(MANIFEST_PATH Cargo.toml) | ||
corrosion_add_cxxbridge(rustlib CRATE openpinebuds_rs FILES lib.rs) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "openpinebuds-rs" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "openpinebuds_rs" | ||
crate-type = ["staticlib"] | ||
|
||
[dependencies] | ||
cxx = "1.0" | ||
|
||
[build-dependencies] | ||
cxx-build = "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Rust library for OpenPineBuds | ||
#![deny( | ||
warnings, | ||
missing_copy_implementations, | ||
missing_debug_implementations, | ||
missing_docs, | ||
clippy::all, | ||
clippy::cargo, | ||
trivial_casts, | ||
trivial_numeric_casts, | ||
unused_import_braces, | ||
unused_qualifications, | ||
unused_extern_crates, | ||
variant_size_differences | ||
)] | ||
|
||
#[cxx::bridge] | ||
mod ffi { | ||
//! Rust FFI module for OpenPineBuds | ||
} |