blob: 50fbebbb099bd7850af4f43a8f3332f1db101154 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# File courtesy of
# https://github.com/tetratelabs/wazero/blob/v1.0.0-pre.3/examples/allocation/rust/testdata/Cargo.toml
[package]
name = "greet"
version = "0.1.0"
edition = "2021"
[lib]
# cdylib builds a a %.wasm file with `cargo build --release --target wasm32-unknown-unknown`
crate-type = ["cdylib"]
name = "greet"
path = "greet.rs"
[dependencies]
# wee_aloc is a WebAssembly optimized allocator, which is needed to use non-numeric types like strings.
# See https://docs.rs/wee_alloc/latest/wee_alloc/
wee_alloc = "0.4.5"
# Below settings dramatically reduce wasm output size
# See https://rustwasm.github.io/book/reference/code-size.html#optimizing-builds-for-code-sizewasm-opt -Oz -o
# See https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1