mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Go back to wasm32
This commit is contained in:
parent
1423d4f50f
commit
c046d417e1
6 changed files with 7 additions and 7 deletions
|
@ -1098,7 +1098,7 @@ mod cli_run {
|
|||
use super::{concatcp, run_roc, CMD_BUILD, TARGET_FLAG};
|
||||
|
||||
let mut flags = flags.to_vec();
|
||||
flags.push(concatcp!(TARGET_FLAG, "=wasm-32"));
|
||||
flags.push(concatcp!(TARGET_FLAG, "=wasm32"));
|
||||
|
||||
let compile_out = run_roc(
|
||||
[CMD_BUILD, file.to_str().unwrap()]
|
||||
|
|
|
@ -181,7 +181,7 @@ pub enum Target {
|
|||
WinX64,
|
||||
#[strum(serialize = "windows-arm-64")]
|
||||
WinArm64,
|
||||
#[strum(serialize = "wasm-32")]
|
||||
#[strum(serialize = "wasm32")]
|
||||
Wasm32,
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ This is an example of calling Roc code from [Node.js](https://nodejs.org/en/).
|
|||
You'll need to have [Zig](https://zig-lang.org) installed. Run this from the current directory:
|
||||
|
||||
```
|
||||
roc build --target=wasm-32
|
||||
roc build --target=wasm32
|
||||
node hello.js
|
||||
```
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const RocStr = str.RocStr;
|
|||
|
||||
comptime {
|
||||
if (builtin.target.cpu.arch != .wasm32) {
|
||||
@compileError("This platform is for WebAssembly only. You need to pass `--target wasm-32` to the Roc compiler.");
|
||||
@compileError("This platform is for WebAssembly only. You need to pass `--target wasm32` to the Roc compiler.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ To run this website, we first compile the app that uses the Wasm platform:
|
|||
|
||||
- If you use the nightly roc release:
|
||||
```bash
|
||||
./roc build --target=wasm-32 examples/platform-switching/rocLovesWebAssembly.roc
|
||||
./roc build --target=wasm32 examples/platform-switching/rocLovesWebAssembly.roc
|
||||
```
|
||||
- If you start from the compiler source code:
|
||||
```bash
|
||||
# Build roc compiler if you have not done so already
|
||||
cargo build
|
||||
target/debug/roc build --target=wasm-32 examples/platform-switching/rocLovesWebAssembly.roc
|
||||
target/debug/roc build --target=wasm32 examples/platform-switching/rocLovesWebAssembly.roc
|
||||
```
|
||||
We then move the file:
|
||||
```bash
|
||||
|
|
|
@ -4,7 +4,7 @@ const RocStr = str.RocStr;
|
|||
|
||||
comptime {
|
||||
if (builtin.target.cpu.arch != .wasm32) {
|
||||
@compileError("This platform is for WebAssembly only. You need to pass `--target wasm-32` to the Roc compiler.");
|
||||
@compileError("This platform is for WebAssembly only. You need to pass `--target wasm32` to the Roc compiler.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue