Skip to content

Commit a714062

Browse files
author
Kyle Criddle
authored
add force-engine feature for enabling engine module (alexcrichton#151)
* add force-engine feature for enabling engine module * add the feature flag to Cargo.toml
1 parent 021754a commit a714062

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ idea = []
3131
# Enables compilation of SEED, a symmetric key block cypher mostly used in South Korea, but
3232
# otherwise not widely supported.
3333
seed = []
34+
# Forces configuring Engine module support.
35+
force-engine = []
3436

3537
[workspace]
3638
members = ['testcrate']

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,13 @@ impl Build {
185185
}
186186

187187
if target.contains("musl") || target.contains("windows") {
188-
// This actually fails to compile on musl (it needs linux/version.h
188+
// Engine module fails to compile on musl (it needs linux/version.h
189189
// right now) but we don't actually need this most of the time.
190190
// API of engine.c ld fail in Windows.
191-
configure.arg("no-engine");
191+
// Disable engine module unless force-engine feature specified
192+
if !cfg!(feature = "force-engine") {
193+
configure.arg("no-engine");
194+
}
192195
}
193196

194197
if target.contains("musl") {

0 commit comments

Comments
 (0)