From 58249591c74c8b6a83356a8eb951edf37f13bda8 Mon Sep 17 00:00:00 2001 From: Schrodinger ZHU Yifan Date: Mon, 30 May 2022 14:19:59 +0800 Subject: [PATCH] enable static library Signed-off-by: Schrodinger ZHU Yifan --- build.sh | 9 ++++++++- raftstore-proxy/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b70f5ee893e..320366f5f87 100755 --- a/build.sh +++ b/build.sh @@ -20,7 +20,14 @@ else echo "rust build-std is disabled" fi -lib_suffix="so" +RAFTSTORE_PROXY_ENABLE_STATIC="${RAFTSTORE_PROXY_ENABLE_STATIC:-0}" + +if $RAFTSTORE_PROXY_ENABLE_STATIC; then + lib_suffix="so" +else + lib_suffix="a" +fi + if [[ $(uname -s) == "Darwin" ]]; then lib_suffix="dylib" # use the openssl 1.1 lib from system diff --git a/raftstore-proxy/Cargo.toml b/raftstore-proxy/Cargo.toml index 229c9f503c7..977ea3fe340 100644 --- a/raftstore-proxy/Cargo.toml +++ b/raftstore-proxy/Cargo.toml @@ -7,7 +7,7 @@ publish = false [lib] name = "raftstore_proxy" -crate-type = ["cdylib"] +crate-type = ["cdylib", "staticlib"] [dependencies] server = { path = "../components/server" }