ignore
This commit is contained in:
parent
ede403613d
commit
8ae1b54c61
|
|
@ -0,0 +1 @@
|
||||||
|
target/
|
||||||
File diff suppressed because it is too large
Load Diff
31
Cargo.toml
31
Cargo.toml
|
|
@ -1,7 +1,16 @@
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "drone_controller"
|
name = "drone_controller"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2018"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["staticlib"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
bindgen = "0.58"
|
||||||
|
cbindgen = "0.19"
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
|
|
@ -14,8 +23,20 @@ serde_json = "1.0.149"
|
||||||
|
|
||||||
clap = { version = "4", features = ["derive"] }
|
clap = { version = "4", features = ["derive"] }
|
||||||
|
|
||||||
[lib]
|
[features]
|
||||||
crate-type = ["lib", "cdylib"]
|
std = []
|
||||||
|
|
||||||
[build-dependencies]
|
[profile.dev]
|
||||||
cbindgen = "0.29"
|
# Optimization level 1 is similar to "g" in gcc/clang, although for some reason
|
||||||
|
# Cargo doesn't support that flag.
|
||||||
|
#opt-level = 1
|
||||||
|
opt-level = "s"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
debug = true
|
||||||
|
opt-level = "z"
|
||||||
|
#debug = true
|
||||||
|
#lto = true
|
||||||
|
#opt-level = "z"
|
||||||
|
#codegen-units = 1
|
||||||
|
#panic = "abort"
|
||||||
|
|
|
||||||
23
build.rs
23
build.rs
|
|
@ -1,11 +1,22 @@
|
||||||
extern crate cbindgen;
|
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let cargo_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
|
||||||
|
let target_dir = PathBuf::from(env::var("CARGO_BUILD_TARGET_DIR").unwrap());
|
||||||
|
|
||||||
let _ = cbindgen::generate(crate_dir)
|
run_cbindgen(&cargo_dir, &target_dir);
|
||||||
.unwrap()
|
}
|
||||||
.write_to_file("bindings.h");
|
|
||||||
|
fn run_cbindgen(cargo_dir: &Path, target_dir: &Path) {
|
||||||
|
let out = target_dir.join("drone_controller.h");
|
||||||
|
|
||||||
|
cbindgen::Builder::new()
|
||||||
|
.with_crate(cargo_dir)
|
||||||
|
.with_language(cbindgen::Language::C)
|
||||||
|
.generate()
|
||||||
|
.expect("Unable to generate bindings")
|
||||||
|
.write_to_file(&out);
|
||||||
|
|
||||||
|
println!("cargo:rerun-if-changed={}", out.display());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
# This is a template cbindgen.toml file with all of the default values.
|
|
||||||
# Some values are commented out because their absence is the real default.
|
|
||||||
#
|
|
||||||
# See https://github.com/mozilla/cbindgen/blob/main/docs.md#cbindgentoml
|
|
||||||
# for detailed documentation of every option here.
|
|
||||||
|
|
||||||
|
|
||||||
language = "C++"
|
|
||||||
|
|
||||||
|
|
||||||
include_guard = "my_bindings_h"
|
|
||||||
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
|
|
||||||
include_version = true
|
|
||||||
|
|
||||||
|
|
||||||
braces = "SameLine"
|
|
||||||
line_length = 100
|
|
||||||
tab_width = 2
|
|
||||||
documentation = true
|
|
||||||
documentation_style = "auto"
|
|
||||||
documentation_length = "full"
|
|
||||||
line_endings = "LF"
|
|
||||||
|
|
||||||
namespace = "dcont"
|
|
||||||
|
|
||||||
|
|
||||||
style = "both"
|
|
||||||
sort_by = "Name"
|
|
||||||
usize_is_size_t = true
|
|
||||||
|
|
||||||
[export]
|
|
||||||
include = []
|
|
||||||
exclude = []
|
|
||||||
# prefix = "DCONT_"
|
|
||||||
item_types = []
|
|
||||||
renaming_overrides_prefixing = false
|
|
||||||
Loading…
Reference in New Issue