This commit is contained in:
2020-05-21 00:43:45 +08:00
parent ac79156632
commit 6e11724316
6 changed files with 26 additions and 4 deletions

5
deno_run_wasm/wasm_sample/Cargo.lock generated Normal file
View File

@@ -0,0 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "warsam_sample"
version = "0.1.0"

View File

@@ -0,0 +1,12 @@
[package]
name = "wasm_sample"
version = "0.1.0"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type =["cdylib"]
[dependencies]

View File

@@ -0,0 +1 @@
cargo build --target wasm32-unknown-unknown

View File

@@ -0,0 +1,4 @@
#[no_mangle]
pub extern "C" fn square(x: u32) -> u32 {
x * x
}