Move libsecp USE_ENDOMORPHISM option behind non-default feature flag

This commit is contained in:
Jonas Nick 2019-06-11 20:32:54 +00:00
parent 3d60a187c9
commit 179f35e0ba
3 changed files with 6 additions and 4 deletions

View File

@ -24,11 +24,11 @@ script:
- cargo build --verbose --features=rand - cargo build --verbose --features=rand
- cargo test --verbose --features=rand - cargo test --verbose --features=rand
- cargo test --verbose --features="rand serde" - cargo test --verbose --features="rand serde"
- cargo test --verbose --features="rand serde recovery" - cargo test --verbose --features="rand serde recovery endomorphism"
- cargo build --verbose --no-default-features - cargo build --verbose --no-default-features
- cargo build --verbose --no-default-features --features="serde" - cargo build --verbose --no-default-features --features="serde"
- cargo build --verbose --no-default-features --features="rand" - cargo build --verbose --no-default-features --features="rand"
- cargo build --verbose --no-default-features --features="rand serde recovery" - cargo build --verbose --no-default-features --features="rand serde recovery endomorphism"
- cargo build --verbose --no-default-features --features="fuzztarget recovery" - cargo build --verbose --no-default-features --features="fuzztarget recovery"
- cargo build --verbose - cargo build --verbose
- cargo test --verbose - cargo test --verbose

View File

@ -15,7 +15,7 @@ build = "build.rs"
# Should make docs.rs show all functions, even those behind non-default features # Should make docs.rs show all functions, even those behind non-default features
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = [ "rand", "serde", "recovery" ] features = [ "rand", "serde", "recovery", "endomorphism" ]
all-features = true all-features = true
[build-dependencies] [build-dependencies]
@ -31,6 +31,7 @@ default = ["std"]
fuzztarget = [] fuzztarget = []
std = [] std = []
recovery = [] recovery = []
endomorphism = []
[dev-dependencies] [dev-dependencies]
rand = "0.6" rand = "0.6"

View File

@ -52,9 +52,10 @@ fn main() {
.define("USE_NUM_NONE", Some("1")) .define("USE_NUM_NONE", Some("1"))
.define("USE_FIELD_INV_BUILTIN", Some("1")) .define("USE_FIELD_INV_BUILTIN", Some("1"))
.define("USE_SCALAR_INV_BUILTIN", Some("1")) .define("USE_SCALAR_INV_BUILTIN", Some("1"))
.define("USE_ENDOMORPHISM", Some("1"))
.define("ENABLE_MODULE_ECDH", Some("1")); .define("ENABLE_MODULE_ECDH", Some("1"));
#[cfg(feature = "endomorphism")]
base_config.define("USE_ENDOMORPHISM", Some("1"));
#[cfg(feature = "recovery")] #[cfg(feature = "recovery")]
base_config.define("ENABLE_MODULE_RECOVERY", Some("1")); base_config.define("ENABLE_MODULE_RECOVERY", Some("1"));