pretty_env_logger = "0.4.0"
[lib]
-crate-type = ["cdylib"]
+crate-type = ["staticlib"]
[build-dependencies]
cbindgen = "0.24.3"
\ No newline at end of file
clean:
- rm ./build/libhello.so
+ rm ./build/*
library:
cargo build --release
build: library
- cp ../../target/release/liball.so ./build
- go build -ldflags="-r build" -o build/all
+ cp ../../target/release/liball.a ./build
+ go build -a -ldflags '-s' -o build/all
all: library build
.to_string();
let config = Config {
- namespace: Some(String::from("ffi")),
language: Language::C,
..Default::default()
};
package main
/*
-#cgo LDFLAGS: -Lbuild -lall
+#cgo LDFLAGS: -L./build -lall -lcrypto -lz -ldl -lssl -lm -static-libgcc
#include "./build/all.h"
*/
import "C"