Skip to content

Commit 94c2d4c

Browse files
authored
Merge pull request #40 from dlrobertson/static
build: add static feature
2 parents f84daec + dd1a47d commit 94c2d4c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ edition = "2018"
1313
[workspace]
1414
members = ["keyutils-raw"]
1515

16+
[features]
17+
static = ["keyutils-raw/static"]
18+
1619
[dev-dependencies]
1720
lazy_static = "1"
1821
regex = "1"

keyutils-raw/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ keywords = ["keyutils"]
1010
links = "keyutils"
1111
edition = "2018"
1212

13+
[features]
14+
static = []
15+
1316
[dependencies]
1417
libc = "0.2"

keyutils-raw/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@
2525
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

2727
fn main() {
28-
println!("cargo:rustc-link-lib=keyutils");
28+
if cfg!(feature = "static") {
29+
println!("cargo:rustc-link-lib=static=keyutils");
30+
} else {
31+
println!("cargo:rustc-link-lib=keyutils");
32+
}
2933
}

0 commit comments

Comments
 (0)