mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-07 16:33:08 +00:00
chore: link required libraries and RLN
This commit is contained in:
parent
1d8626b110
commit
ca72e70bb6
1973
Cargo.lock
generated
1973
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ url = "2.3"
|
|||||||
waku-sys = { version = "0.5.0", path = "../waku-sys" }
|
waku-sys = { version = "0.5.0", path = "../waku-sys" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
serde-aux = "4.3.1"
|
serde-aux = "4.3.1"
|
||||||
|
rln = "0.3.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
futures = "0.3.25"
|
futures = "0.3.25"
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
//! # Waku
|
//! # Waku
|
||||||
//!
|
//!
|
||||||
//! Implementation on top of [`waku-bindings`](https://rfc.vac.dev/spec/36/)
|
//! Implementation on top of [`waku-bindings`](https://rfc.vac.dev/spec/36/)
|
||||||
mod events;
|
|
||||||
mod general;
|
mod general;
|
||||||
mod node;
|
mod node;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
|
use rln;
|
||||||
|
|
||||||
pub use node::{
|
pub use node::{
|
||||||
waku_create_content_topic, waku_default_pubsub_topic, waku_new, Key, Multiaddr, PublicKey,
|
waku_create_content_topic, waku_default_pubsub_topic, waku_new, Event, Key, Multiaddr,
|
||||||
SecretKey, WakuNodeConfig, WakuNodeHandle,
|
PublicKey, SecretKey, Signal, WakuMessageEvent, WakuNodeConfig, WakuNodeHandle,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use general::{
|
pub use general::{
|
||||||
Encoding, MessageId, Result, WakuContentTopic, WakuMessage, WakuMessageVersion, WakuPubSubTopic,
|
Encoding, MessageId, Result, WakuContentTopic, WakuMessage, WakuMessageVersion, WakuPubSubTopic,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use events::{waku_set_event_callback, Event, Signal, WakuMessageEvent};
|
|
||||||
|
|||||||
@ -35,3 +35,4 @@ crate-type = ["rlib"]
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
bindgen = "0.64"
|
bindgen = "0.64"
|
||||||
|
cc = "1.0"
|
||||||
|
|||||||
@ -3,6 +3,8 @@ use std::env::set_current_dir;
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
extern crate cc;
|
||||||
|
|
||||||
fn build_nwaku_lib(project_dir: &Path) {
|
fn build_nwaku_lib(project_dir: &Path) {
|
||||||
let vendor_path = project_dir.join("vendor");
|
let vendor_path = project_dir.join("vendor");
|
||||||
|
|
||||||
@ -19,12 +21,25 @@ fn build_nwaku_lib(project_dir: &Path) {
|
|||||||
|
|
||||||
fn generate_bindgen_code(project_dir: &Path) {
|
fn generate_bindgen_code(project_dir: &Path) {
|
||||||
let vendor_path = project_dir.join("vendor");
|
let vendor_path = project_dir.join("vendor");
|
||||||
let build_dir = vendor_path.join("build");
|
|
||||||
let header_path = vendor_path.join("library/libwaku.h");
|
let header_path = vendor_path.join("library/libwaku.h");
|
||||||
|
|
||||||
println!("cargo:rustc-link-search={}", build_dir.display());
|
cc::Build::new()
|
||||||
println!("cargo:rustc-link-lib=static=waku");
|
.object(vendor_path.join("vendor/nim-libbacktrace/libbacktrace_wrapper.o").display().to_string())
|
||||||
|
.compile("libbacktrace_wrapper");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed={}", header_path.display());
|
println!("cargo:rerun-if-changed={}", header_path.display());
|
||||||
|
println!("cargo:rustc-link-search={}", vendor_path.join("build").display());
|
||||||
|
println!("cargo:rustc-link-lib=static=waku");
|
||||||
|
println!("cargo:rustc-link-search={}", vendor_path.join("vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/build").display());
|
||||||
|
println!("cargo:rustc-link-lib=static=miniupnpc");
|
||||||
|
println!("cargo:rustc-link-search={}", vendor_path.join("vendor/nim-nat-traversal/vendor/libnatpmp-upstream").display());
|
||||||
|
println!("cargo:rustc-link-lib=static=natpmp");
|
||||||
|
println!("cargo:rustc-link-lib=dl");
|
||||||
|
println!("cargo:rustc-link-lib=m");
|
||||||
|
println!("cargo:rustc-link-search=native={}", vendor_path.join("vendor/nim-libbacktrace/install/usr/lib").display());
|
||||||
|
println!("cargo:rustc-link-lib=static=backtrace");
|
||||||
|
|
||||||
|
// TODO: Determine if pthread is automatically included
|
||||||
|
|
||||||
// Generate waku bindings with bindgen
|
// Generate waku bindings with bindgen
|
||||||
let bindings = bindgen::Builder::default()
|
let bindings = bindgen::Builder::default()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user