Skip to content

Commit

Permalink
Add a deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Sep 11, 2024
1 parent 242acfa commit 56656f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CPackage>, 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() {
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct Common {
#[clap(long = "datadir")]
datadir: Option<PathBuf>,
#[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<PathBuf>,
#[clap(long = "crt-static")]
/// Build the library embedding the C runtime
Expand Down

0 comments on commit 56656f8

Please sign in to comment.