forked from rust-lang/cc-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR exposes cc's inferred archiver through a similar mechanism as `get_compiler`: with `get_archiver`/`try_get_archiver`. As part of this, I also realized that cc wouldn't pick up `ARFLAGS`, so I added support for that. Through that, I also realized that there was currently one place where we didn't respect `Build::ar_flags` when ar was called, so I fixed that too. Since ranlib is exposed more or less exactly like ar, I also added a `get_ranlib`/`try_get_ranlib` combination. This is, in part, to enable `openssl-src` to move to re-use `cc`'s AR (and now RANLIB) detection rather than rolling its own. See alexcrichton/openssl-src-rs#164. Note that I didn't re-use `Tool` for the return value for these getter functions, and instead just exposed `Command` directly. `Tool` has a number of relatively compiler-specific things, so it felt wrong to use. One important caveat to this is that `Command::get_program` was only added in Rust 1.57.0, so users on older versions of Rust won't have a way to recover the inferred `ar` program path, but that feels like it's probably okay given that we didn't even expose `get_archive` until now.
- Loading branch information
Jon Gjengset
committed
Dec 12, 2022
1 parent
0e51f6d
commit 1a183cd
Showing
1 changed file
with
189 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters