From 56656f8abb27362ccfb73ad45beaf77c254ef161 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 11 Sep 2024 08:14:04 +0200 Subject: [PATCH] Add a deprecation warning --- src/build.rs | 12 ++++++++++++ src/cli.rs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/build.rs b/src/build.rs index 35bc866f..5d94ca9b 100644 --- a/src/build.rs +++ b/src/build.rs @@ -988,12 +988,24 @@ impl CPackage { } } +fn deprecation_warnings(ws: &Workspace, args: &ArgMatches) -> anyhow::Result<()> { + if args.contains_id("dlltool") { + ws.gctx() + .shell() + .warn("The `dlltool` support is now builtin. The cli option is deprecated and will be removed in the future")?; + } + + Ok(()) +} + pub fn cbuild( ws: &mut Workspace, config: &GlobalContext, args: &ArgMatches, default_profile: &str, ) -> anyhow::Result<(Vec, CompileOptions)> { + deprecation_warnings(ws, args)?; + let rustc = config.load_global_rustc(Some(ws))?; let targets = args.targets()?; let (target, is_target_overridden) = match targets.len() { diff --git a/src/cli.rs b/src/cli.rs index 106e23dc..43293aa6 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -47,7 +47,7 @@ struct Common { #[clap(long = "datadir")] datadir: Option, #[clap(long = "dlltool")] - /// Use the provided dlltool when building for the windows-gnu targets. + /// Use the provided dlltool when building for the windows-gnu targets. (deprecated and no-op) dlltool: Option, #[clap(long = "crt-static")] /// Build the library embedding the C runtime