Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Support selecting static builds for windows only
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Apr 5, 2020
1 parent 546e8f2 commit 0cbf5d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ rmp-serde = "^0.13.7"
benchmarks = []
std = []
default = ["serde", "std"]
# use-pkg-config should be deprecated in the future and become the default
use-pkg-config = ["libsodium-sys/use-pkg-config"]
# always force a static build, even if use-pkg-config becomes the default
static = ["libsodium-sys/static"]
# only force a static build on windows
static-windows = ["libsodium-sys/static-windows"]
5 changes: 5 additions & 0 deletions libsodium-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ libc = { version = "0.2" , default-features = false }
name = "libsodium_sys"

[features]
# use-pkg-config should be deprecated in the future and become the default
use-pkg-config = []
# always force a static build, even if use-pkg-config becomes the default
static = []
# only force a static build on windows
static-windows = []
2 changes: 1 addition & 1 deletion libsodium-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() {

let lib_dir_isset = env::var("SODIUM_LIB_DIR").is_ok();
let use_pkg_isset = if cfg!(feature = "use-pkg-config") {
true
cfg!(not(feature = "static")) && cfg!(not(all(feature = "static-windows", windows)))
} else {
env::var("SODIUM_USE_PKG_CONFIG").is_ok()
};
Expand Down

0 comments on commit 0cbf5d6

Please sign in to comment.