Skip to content

Commit d580076

Browse files
committed
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 ff0d6b1 commit d580076

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

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 {
@@ -28,7 +28,7 @@ fn main() {
2828
.arg("FC=") // Don't try to find Fortran (unused library build/install)
2929
.env("MAKEFLAGS", makeflags)
3030
.current_dir("c-src");
31-
if statik {
31+
if !shared {
3232
make.arg("STATIC=1");
3333
}
3434
run(&mut make);
@@ -40,7 +40,7 @@ fn main() {
4040
.into_owned()
4141
};
4242
pkg_config::Config::new()
43-
.statik(statik)
43+
.statik(!shared)
4444
.atleast_version("0.12.0")
4545
.probe(&ceed_pc)
4646
.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)