Go back to wasm32

This commit is contained in:
Richard Feldman 2023-06-20 08:06:34 -04:00
parent 1423d4f50f
commit c046d417e1
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
6 changed files with 7 additions and 7 deletions

View file

@ -1098,7 +1098,7 @@ mod cli_run {
use super::{concatcp, run_roc, CMD_BUILD, TARGET_FLAG}; use super::{concatcp, run_roc, CMD_BUILD, TARGET_FLAG};
let mut flags = flags.to_vec(); let mut flags = flags.to_vec();
flags.push(concatcp!(TARGET_FLAG, "=wasm-32")); flags.push(concatcp!(TARGET_FLAG, "=wasm32"));
let compile_out = run_roc( let compile_out = run_roc(
[CMD_BUILD, file.to_str().unwrap()] [CMD_BUILD, file.to_str().unwrap()]

View file

@ -181,7 +181,7 @@ pub enum Target {
WinX64, WinX64,
#[strum(serialize = "windows-arm-64")] #[strum(serialize = "windows-arm-64")]
WinArm64, WinArm64,
#[strum(serialize = "wasm-32")] #[strum(serialize = "wasm32")]
Wasm32, Wasm32,
} }

View file

@ -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: 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 node hello.js
``` ```

View file

@ -4,7 +4,7 @@ const RocStr = str.RocStr;
comptime { comptime {
if (builtin.target.cpu.arch != .wasm32) { 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.");
} }
} }

View file

@ -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: - If you use the nightly roc release:
```bash ```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: - If you start from the compiler source code:
```bash ```bash
# Build roc compiler if you have not done so already # Build roc compiler if you have not done so already
cargo build 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: We then move the file:
```bash ```bash

View file

@ -4,7 +4,7 @@ const RocStr = str.RocStr;
comptime { comptime {
if (builtin.target.cpu.arch != .wasm32) { 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.");
} }
} }