fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
16bf64f9
0.5.0
1# Copyright 2020 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# buildifier: disable=module-docstring 16load ( "@build_bazel_rules_nodejs//:index.bzl" , "nodejs_test" ) 17load ( "@rules_rust//rust:defs.bzl" , "rust_binary" , "rust_shared_library" ) 18load ( "@rules_rust//wasm_bindgen:wasm_bindgen.bzl" , "rust_wasm_bindgen" ) 19 20package ( default_visibility = [ "//visibility:public" ]) 21 22rust_binary ( 23name = "hello_world_bin_wasm" , 24srcs = [ "main.rs" ], 25edition = "2018" , 26deps = [ 27"@rules_rust//wasm_bindgen/raze:wasm_bindgen" , 28], 29) 30 31rust_shared_library ( 32name = "hello_world_lib_wasm" , 33srcs = [ "main.rs" ], 34edition = "2018" , 35deps = [ 36"@rules_rust//wasm_bindgen/raze:wasm_bindgen" , 37], 38) 39 40rust_wasm_bindgen ( 41name = "hello_world_bundler_wasm_bindgen" , 42wasm_file = ":hello_world_bin_wasm" , 43) 44 45rust_wasm_bindgen ( 46name = "hello_world_web_wasm_bindgen" , 47target = "web" , 48wasm_file = ":hello_world_lib_wasm" , 49) 50 51rust_wasm_bindgen ( 52name = "hello_world_deno_wasm_bindgen" , 53target = "deno" , 54wasm_file = ":hello_world_lib_wasm" , 55) 56 57rust_wasm_bindgen ( 58name = "hello_world_nomodules_wasm_bindgen" , 59target = "no-modules" , 60wasm_file = ":hello_world_lib_wasm" , 61) 62 63rust_wasm_bindgen ( 64name = "hello_world_nodejs_wasm_bindgen" , 65target = "nodejs" , 66wasm_file = ":hello_world_lib_wasm" , 67) 68 69nodejs_test ( 70name = "hello_world_wasm_test" , 71data = [ 72":hello_world_bundler_wasm_bindgen" , 73":hello_world_deno_wasm_bindgen" , 74":hello_world_nodejs_wasm_bindgen" , 75":hello_world_nomodules_wasm_bindgen" , 76":hello_world_web_wasm_bindgen" , 77], 78entry_point = "hello_world_wasm_test.js" , 79)