Tiny docs

This commit is contained in:
danielsanchezq 2022-09-23 08:47:28 +02:00
parent 1dd73da1be
commit 5c35417f49
2 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,3 @@
# Waku Rust binding
Rust layer on top of `go-waku` c ffi bindings.

View File

@ -5,8 +5,10 @@ use std::path::PathBuf;
use std::process::Command; use std::process::Command;
fn main() { fn main() {
// Build go-waku static lib
// build command taken from waku make file:
// https://github.com/status-im/go-waku/blob/eafbc4c01f94f3096c3201fb1e44f17f907b3068/Makefile#L115
let output_lib = "libgowaku.a"; let output_lib = "libgowaku.a";
set_current_dir("./vendor").unwrap(); set_current_dir("./vendor").unwrap();
Command::new("go") Command::new("go")
.arg("build") .arg("build")
@ -18,7 +20,6 @@ fn main() {
.map_err(|e| println!("cargo:warning={}", e)) .map_err(|e| println!("cargo:warning={}", e))
.unwrap(); .unwrap();
set_current_dir("../").unwrap(); set_current_dir("../").unwrap();
let mut lib_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); let mut lib_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
lib_dir.push("vendor"); lib_dir.push("vendor");
lib_dir.push("build"); lib_dir.push("build");
@ -27,9 +28,8 @@ fn main() {
println!("cargo:rustc-link-search={}", lib_dir.display()); println!("cargo:rustc-link-search={}", lib_dir.display());
println!("cargo:rustc-link-lib=static=gowaku"); println!("cargo:rustc-link-lib=static=gowaku");
println!("cargo:rerun-if-changed=libgowaku.h"); println!("cargo:rerun-if-changed=libgowaku.h");
// The bindgen::Builder is the main entry point
// to bindgen, and lets you build up options for // Generate waku bindings with bindgen
// the resulting bindings.
let bindings = bindgen::Builder::default() let bindings = bindgen::Builder::default()
// The input header we would like to generate // The input header we would like to generate
// bindings for. // bindings for.