use LinkSelfContained for -C link-self-contained

This commit is contained in:
Rémy Rakic 2023-06-21 21:46:36 +00:00
parent 5d91c1ced4
commit 0fb80715bb
4 changed files with 91 additions and 4 deletions

View file

@ -1688,7 +1688,7 @@ fn detect_self_contained_mingw(sess: &Session) -> bool {
/// instead of being found somewhere on the host system.
/// We only provide such support for a very limited number of targets.
fn self_contained(sess: &Session, crate_type: CrateType) -> bool {
if let Some(self_contained) = sess.opts.cg.link_self_contained {
if let Some(self_contained) = sess.opts.cg.link_self_contained.explicitly_set {
if sess.target.link_self_contained == LinkSelfContainedDefault::False {
sess.emit_err(errors::UnsupportedLinkSelfContained);
}