Skip to content

Commit

Permalink
Remove the curl-compat feature
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Dec 19, 2024
1 parent d5b837f commit 4e6e4d0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 81 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ make-cmd = "0.1"
target = "2.0"
syn = { version = "2", features = ["full"] } # git-version fails to parse inner macros without this.

[build-dependencies.rustflags]
version = "0.1"
optional = true

[dev-dependencies]
tempfile = "3"

Expand All @@ -160,8 +156,6 @@ panic = "abort"
[features]
default = ["full-version", "version-check"]
full-version = ["dep:concat_const", "dep:git-version"]
# libcurl.so compatibility (Linux only).
curl-compat = ["rustflags"]
# Check and report when a new version is available.
version-check = ["shared_child"]
# Download and apply new versions.
Expand Down
39 changes: 0 additions & 39 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,45 +209,6 @@ fn main() {
println!("cargo:rerun-if-env-changed=CC");
println!("cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS");

#[cfg(feature = "curl-compat")]
{
use rustflags::Flag;
if target_os != "linux" {
panic!("The curl-compat feature is only supported on linux");
} else if std::env::var("DEP_CURL_STATIC").is_ok() {
panic!("The curl-compat feature is not compatible with building curl statically");
}
let mut cmd = compiler.to_command();
cmd.args(&[
"-shared",
"-Wl,-soname,libcurl.so.4",
"src/curl-compat.c",
"-o",
]);
let curl_dir = PathBuf::from(env_os("OUT_DIR"));
cmd.arg(curl_dir.join("libcurl.so"));
if let Ok(include) = std::env::var("DEP_CURL_INCLUDE") {
cmd.arg(format!("-I{}", normalize_path(&include)));
}
cmd.args(rustflags::from_env().flat_map(|flag| match flag {
Flag::Codegen {
opt,
value: Some(value),
} if opt == "link-arg" => vec![value],
Flag::Codegen {
opt,
value: Some(value),
} if opt == "link-args" => value.split(' ').map(ToString::to_string).collect(),
_ => vec![],
}));
match cmd.status() {
Ok(s) if s.success() => {}
_ => panic!("Failed to build libcurl.so with command {:?}", cmd),
}
println!("cargo:rerun-if-changed=src/curl-compat.c");
println!("cargo:rustc-link-search=native={}", curl_dir.display());
}

assert!(cmd
.env("MAKEFLAGS", format!("-j {}", env("CARGO_MAKEFLAGS")))
.current_dir(&out_dir)
Expand Down
29 changes: 0 additions & 29 deletions src/curl-compat.c

This file was deleted.

0 comments on commit 4e6e4d0

Please sign in to comment.