| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # This file shows how to target an unknown-unknown-wasm |
| # triple in-tree. |
| # |
| # In the long run, other triples will likely replace this as the standard |
| # and this may even be removed. Using this toolchain should be considered |
| # *Highly Experimental*. |
| |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_wasm_library.gni") |
| |
| rustc_binary("bin") { |
| name = "wasm_toolchain_example" |
| } |
| |
| rustc_library("lib") { |
| name = "wasm_toolchain_example_lib" |
| } |
| |
| if (current_toolchain == unknown_wasm32_toolchain) { |
| rustc_wasm_library("lib_wasm") { |
| name = "wasm_toolchain_example_lib_wasm" |
| } |
| } |
| |
| group("toolchain") { |
| deps = [ |
| ":bin($unknown_wasm32_toolchain)", |
| ":lib($unknown_wasm32_toolchain)", |
| ":lib_wasm($unknown_wasm32_toolchain)", |
| ] |
| } |