1
Fork 0

Rollup merge of #84072 - nagisa:target-family-two-the-movie, r=petrochenkov

Allow setting `target_family` to multiple values, and implement `target_family="wasm"`

As per the conclusion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Are.20we.20comfortable.20with.20adding.20an.20insta-stable.20cfg.28wasm.29.3F/near/233158441), this implements an ability to specify any number of `target_family` values, allowing for more flexible generic groups, or "families", to be created than just the OS-based unix/windows dichotomy.

cc https://github.com/rust-lang/reference/pull/1006
This commit is contained in:
Dylan DPC 2021-05-03 00:32:40 +02:00 committed by GitHub
commit 966e9e2471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 44 additions and 34 deletions

View file

@ -816,7 +816,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
ret.reserve(6); // the minimum number of insertions
// Target bindings.
ret.insert((sym::target_os, Some(Symbol::intern(os))));
if let Some(ref fam) = sess.target.os_family {
for fam in &sess.target.families {
ret.insert((sym::target_family, Some(Symbol::intern(fam))));
if fam == "windows" {
ret.insert((sym::windows, None));