Split monolithic raw crates into sys crates
Creating a crate for bwd-gc highlights the fact that it would be nice to fix 2! The file blocklist is a lost less unmaintainable then the more fine-grained one we had before. Fix #9
This commit is contained in:
parent
485070ffa9
commit
dbb00333b1
51 changed files with 571 additions and 104 deletions
15
nix-bindings-bdwgc-sys/Cargo.toml
Normal file
15
nix-bindings-bdwgc-sys/Cargo.toml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[package]
|
||||
name = "nix-bindings-bdwgc-sys"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
build = "build.rs"
|
||||
license = "LGPL-2.1"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = "0.69"
|
||||
pkg-config = "0.3"
|
||||
4
nix-bindings-bdwgc-sys/README.md
Normal file
4
nix-bindings-bdwgc-sys/README.md
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# nix-bindings-bdwgc-sys
|
||||
|
||||
This crate contains generated bindings for the Boehm-Demers-Weiser garbage collector (`bdw-gc`).
|
||||
**You should not have to use this crate directly,** and so you should probably not add it to your dependencies.
|
||||
27
nix-bindings-bdwgc-sys/build.rs
Normal file
27
nix-bindings-bdwgc-sys/build.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=include/bdwgc.h");
|
||||
|
||||
let mut args = Vec::new();
|
||||
for path in pkg_config::probe_library("bdw-gc")
|
||||
.unwrap()
|
||||
.include_paths
|
||||
.iter()
|
||||
{
|
||||
args.push(format!("-I{}", path.to_str().unwrap()));
|
||||
}
|
||||
|
||||
let bindings = bindgen::Builder::default()
|
||||
.header("include/bdwgc.h")
|
||||
.clang_args(args)
|
||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
|
||||
.generate()
|
||||
.expect("Unable to generate bindings");
|
||||
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
bindings
|
||||
.write_to_file(out_path.join("bindings.rs"))
|
||||
.expect("Couldn't write bindings!");
|
||||
}
|
||||
2
nix-bindings-bdwgc-sys/include/bdwgc.h
Normal file
2
nix-bindings-bdwgc-sys/include/bdwgc.h
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#define GC_THREADS
|
||||
#include <gc/gc.h>
|
||||
7
nix-bindings-bdwgc-sys/src/lib.rs
Normal file
7
nix-bindings-bdwgc-sys/src/lib.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(clippy::all)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
Loading…
Add table
Add a link
Reference in a new issue