Add target to use LLVM wasm backend
The new target is wasm32-experimental-emscripten. Adds a new configuration option to opt in to building experimental LLVM backends such as the WebAssembly backend. The target name was chosen to be similar to the existing wasm32-unknown-emscripten target so that the build and tests would work with minimal other code changes. When/if the new target replaces the old target, simply renaming it should just work.
This commit is contained in:
parent
fe7227f6c8
commit
a1981a64a2
7 changed files with 77 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ fn main() {
|
|||
|
||||
let mut optional_components =
|
||||
vec!["x86", "arm", "aarch64", "mips", "powerpc", "pnacl",
|
||||
"systemz", "jsbackend", "msp430", "sparc", "nvptx"];
|
||||
"systemz", "jsbackend", "webassembly", "msp430", "sparc", "nvptx"];
|
||||
|
||||
let mut version_cmd = Command::new(&llvm_config);
|
||||
version_cmd.arg("--version");
|
||||
|
|
|
|||
|
|
@ -389,6 +389,11 @@ pub fn initialize_available_targets() {
|
|||
LLVMInitializeHexagonTargetMC,
|
||||
LLVMInitializeHexagonAsmPrinter,
|
||||
LLVMInitializeHexagonAsmParser);
|
||||
init_target!(llvm_component = "webassembly",
|
||||
LLVMInitializeWebAssemblyTargetInfo,
|
||||
LLVMInitializeWebAssemblyTarget,
|
||||
LLVMInitializeWebAssemblyTargetMC,
|
||||
LLVMInitializeWebAssemblyAsmPrinter);
|
||||
}
|
||||
|
||||
pub fn last_error() -> Option<String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue