Set target_family="wasm" for wasm targets
This commit is contained in:
parent
4afea69090
commit
1a491e2304
@ -1046,7 +1046,7 @@ pub struct TargetOptions {
|
|||||||
///
|
///
|
||||||
/// Common options are: "unix", "windows". Defaults to no families.
|
/// Common options are: "unix", "windows". Defaults to no families.
|
||||||
///
|
///
|
||||||
/// See https://doc.rust-lang.org/reference/conditional-compilation.html#target_family
|
/// See <https://doc.rust-lang.org/reference/conditional-compilation.html#target_family>.
|
||||||
pub families: Vec<String>,
|
pub families: Vec<String>,
|
||||||
/// Whether the target toolchain's ABI supports returning small structs as an integer.
|
/// Whether the target toolchain's ABI supports returning small structs as an integer.
|
||||||
pub abi_return_struct_as_int: bool,
|
pub abi_return_struct_as_int: bool,
|
||||||
|
@ -61,6 +61,7 @@ pub fn options() -> TargetOptions {
|
|||||||
|
|
||||||
TargetOptions {
|
TargetOptions {
|
||||||
is_like_wasm: true,
|
is_like_wasm: true,
|
||||||
|
families: vec!["wasm".to_string()],
|
||||||
|
|
||||||
// we allow dynamic linking, but only cdylibs. Basically we allow a
|
// we allow dynamic linking, but only cdylibs. Basically we allow a
|
||||||
// final library artifact that exports some symbols (a wasm module) but
|
// final library artifact that exports some symbols (a wasm module) but
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// run-pass
|
// build-pass
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
// ignore-wasm32-bare no target_family
|
// ignore-wasm32-bare no bare family
|
||||||
// ignore-sgx
|
// ignore-sgx
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// run-pass
|
// build-pass
|
||||||
// ignore-wasm32-bare no target_family
|
|
||||||
// ignore-sgx
|
// ignore-sgx
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
@ -11,3 +10,7 @@ pub fn main() {
|
|||||||
#[cfg(target_family = "unix")]
|
#[cfg(target_family = "unix")]
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_family="wasm")]
|
||||||
|
pub fn main() {
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user