From 26dc3c81d8ebee5f7ec40835e29bf9f37e648ab2 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 9 Aug 2023 12:50:05 -0400 Subject: [PATCH] add force-engine feature flag (#205) --- Cargo.toml | 2 ++ src/lib.rs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6b3f5495..4d61b395 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,8 @@ idea = [] # Enables compilation of SEED, a symmetric key block cypher mostly used in South Korea, but # otherwise not widely supported. seed = [] +# Forces configuring Engine module support. +force-engine = [] [workspace] members = ['testcrate'] diff --git a/src/lib.rs b/src/lib.rs index 3878aa2a..c29df637 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -196,9 +196,12 @@ impl Build { } if target.contains("musl") { - // This actually fails to compile on musl (it needs linux/version.h + // Engine module fails to compile on musl (it needs linux/version.h // right now) but we don't actually need this most of the time. - configure.arg("no-engine"); + // Disable engine module unless force-engine feature specified + if !cfg!(feature = "force-engine") { + configure.arg("no-engine"); + } } else if target.contains("windows") { // We can build the engine feature, but the build doesn't seem // to correctly pick up crypt32.lib functions such as