Skip to content

Commit ce622e3

Browse files
jedbrownjeremylt
authored andcommitted
WIP: cargo: change libceed feature static to shared
This way no features are activated by default. It has the downside that if only the shared feature is enabled, it will attempt to statically link to the system library (which is most likely a shared library).
1 parent b227987 commit ce622e3

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

rust/libceed-sys/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ include = [
2525
]
2626

2727
[features]
28-
default = ["static"]
29-
static = []
28+
shared = []
3029
system = []
3130

3231
[build-dependencies]

rust/libceed-sys/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::process::Command;
66

77
fn main() {
88
let out_dir = PathBuf::from(env("OUT_DIR").unwrap());
9-
let statik = env("CARGO_FEATURE_STATIC").is_some();
9+
let shared = env("CARGO_FEATURE_SHARED").is_some();
1010
let system = env("CARGO_FEATURE_SYSTEM").is_some();
1111

1212
let ceed_pc = if system {
@@ -32,7 +32,7 @@ fn main() {
3232
if optflags.len() > 0 {
3333
make.env("OPT", optflags);
3434
}
35-
if statik {
35+
if !shared {
3636
make.arg("STATIC=1");
3737
}
3838
run(&mut make);
@@ -44,7 +44,7 @@ fn main() {
4444
.into_owned()
4545
};
4646
pkg_config::Config::new()
47-
.statik(statik)
47+
.statik(!shared)
4848
.atleast_version("0.12.0")
4949
.probe(&ceed_pc)
5050
.unwrap();

rust/libceed/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ katexit = { version = "0.1.1", optional = true }
2525
version-sync = "0.9.2"
2626

2727
[features]
28-
default = ["static"]
29-
static = ["libceed-sys/static"]
28+
shared = ["libceed-sys/shared"]
3029
system = ["libceed-sys/system"]
3130

3231
[package.metadata.docs.rs]

0 commit comments

Comments
 (0)