]> git.puffer.fish Git - matthieu/nova.git/commitdiff
statically link liball.a
authorMatthieuCoder <matthieu@matthieu-dev.xyz>
Mon, 2 Jan 2023 22:32:01 +0000 (02:32 +0400)
committerMatthieuCoder <matthieu@matthieu-dev.xyz>
Mon, 2 Jan 2023 22:32:01 +0000 (02:32 +0400)
exes/all/Cargo.toml
exes/all/Makefile
exes/all/build.rs
exes/all/main.go

index d6976ef5b082f1af73b09b1799b0a1aef0dbb9ce..41396fcf2e59b6f6bd9bc1b52aac4c08ef934885 100644 (file)
@@ -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
index 07c02d9c5614725af198273cbfd79e101963cd3a..22a67e0b9c1f04c60672e189ccbeaf35c5cff5c5 100644 (file)
@@ -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
 
index e779d5332a1f0b59bf8ba3e2badfa59319a3759c..c52ad11333d796bd41cda4836790617f81e6cf6d 100644 (file)
@@ -15,7 +15,6 @@ fn main() {
         .to_string();
 
     let config = Config {
-        namespace: Some(String::from("ffi")),
         language: Language::C,
         ..Default::default()
     };
index 0d15450e6de119b4960def388bdc466dfab5b5e3..6e1f7c0f1f777ab432fba6852d8042d9f71478e3 100644 (file)
@@ -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"