diff options
| author | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-03 02:32:01 +0400 | 
|---|---|---|
| committer | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-03 02:32:01 +0400 | 
| commit | 9ceaf1d6be6116fb916e60d593b2fffdfa4de66c (patch) | |
| tree | 1d07f97537dab5cfcc675720253dc512d2dc5dd6 /exes | |
| parent | 91a27342dbee8ca0478f862df93bf502337f4c6e (diff) | |
statically link liball.a
Diffstat (limited to 'exes')
| -rw-r--r-- | exes/all/Cargo.toml | 2 | ||||
| -rw-r--r-- | exes/all/Makefile | 6 | ||||
| -rw-r--r-- | exes/all/build.rs | 1 | ||||
| -rw-r--r-- | exes/all/main.go | 2 | 
4 files changed, 5 insertions, 6 deletions
diff --git a/exes/all/Cargo.toml b/exes/all/Cargo.toml index d6976ef..41396fc 100644 --- a/exes/all/Cargo.toml +++ b/exes/all/Cargo.toml @@ -25,7 +25,7 @@ config = "0.13.3"  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 diff --git a/exes/all/Makefile b/exes/all/Makefile index 07c02d9..22a67e0 100644 --- a/exes/all/Makefile +++ b/exes/all/Makefile @@ -1,12 +1,12 @@  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 diff --git a/exes/all/build.rs b/exes/all/build.rs index e779d53..c52ad11 100644 --- a/exes/all/build.rs +++ b/exes/all/build.rs @@ -15,7 +15,6 @@ fn main() {          .to_string();      let config = Config { -        namespace: Some(String::from("ffi")),          language: Language::C,          ..Default::default()      }; diff --git a/exes/all/main.go b/exes/all/main.go index 0d15450..6e1f7c0 100644 --- a/exes/all/main.go +++ b/exes/all/main.go @@ -1,7 +1,7 @@  package main  /* -#cgo LDFLAGS: -Lbuild -lall +#cgo LDFLAGS: -L./build -lall -lcrypto -lz -ldl -lssl -lm -static-libgcc  #include "./build/all.h"  */  import "C"  | 
