Skip to content

Commit

Permalink
Set target_family="wasm" for wasm targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Apr 10, 2021
1 parent bf922f9 commit 5aca958
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/wasm_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn options() -> TargetOptions {

TargetOptions {
is_like_wasm: true,
families: vec!["wasm".to_string()],

// we allow dynamic linking, but only cdylibs. Basically we allow a
// final library artifact that exports some symbols (a wasm module) but
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/cfg/cfg-family.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-pass
// build-pass
// pretty-expanded FIXME #23616
// ignore-wasm32-bare no target_family
// ignore-wasm32-bare no bare family
// ignore-sgx

#[cfg(windows)]
Expand Down
7 changes: 5 additions & 2 deletions src/test/ui/cfg/cfg-target-family.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
// ignore-wasm32-bare no target_family
// build-pass
// ignore-sgx

// pretty-expanded FIXME #23616
Expand All @@ -11,3 +10,7 @@ pub fn main() {
#[cfg(target_family = "unix")]
pub fn main() {
}

#[cfg(target_family="wasm")]
pub fn main() {
}

0 comments on commit 5aca958

Please sign in to comment.