Skip to content

Commit

Permalink
add force-engine feature for enabling engine module (#151)
Browse files Browse the repository at this point in the history
* add force-engine feature for enabling engine module

* add the feature flag to Cargo.toml
  • Loading branch information
neuronull authored Jul 25, 2022
1 parent 021754a commit a714062
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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']
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ impl Build {
}

if target.contains("musl") || target.contains("windows") {
// 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.
// API of engine.c ld fail in Windows.
configure.arg("no-engine");
// Disable engine module unless force-engine feature specified
if !cfg!(feature = "force-engine") {
configure.arg("no-engine");
}
}

if target.contains("musl") {
Expand Down

0 comments on commit a714062

Please sign in to comment.