github.com/apache/beam/sdks/v2@v2.48.2/go/examples/wasm/Cargo.toml (about) 1 # Licensed to the Apache Software Foundation (ASF) under one or more 2 # contributor license agreements. See the NOTICE file distributed with 3 # this work for additional information regarding copyright ownership. 4 # The ASF licenses this file to You under the Apache License, Version 2.0 5 # (the "License"); you may not use this file except in compliance with 6 # the License. You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 # File courtesy of 17 # https://github.com/tetratelabs/wazero/blob/v1.0.0-pre.3/examples/allocation/rust/testdata/Cargo.toml 18 [package] 19 name = "greet" 20 version = "0.1.0" 21 edition = "2021" 22 23 [lib] 24 # cdylib builds a a %.wasm file with `cargo build --release --target wasm32-unknown-unknown` 25 crate-type = ["cdylib"] 26 name = "greet" 27 path = "greet.rs" 28 29 [dependencies] 30 # wee_aloc is a WebAssembly optimized allocator, which is needed to use non-numeric types like strings. 31 # See https://docs.rs/wee_alloc/latest/wee_alloc/ 32 wee_alloc = "0.4.5" 33 34 # Below settings dramatically reduce wasm output size 35 # See https://rustwasm.github.io/book/reference/code-size.html#optimizing-builds-for-code-sizewasm-opt -Oz -o 36 # See https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units 37 [profile.release] 38 opt-level = "z" 39 lto = true 40 codegen-units = 1