fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
97264b79
0.11.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 15load ( "@build_bazel_rules_nodejs//:index.bzl" , "nodejs_test" ) 16load ( "@rules_rust//rust:defs.bzl" , "rust_binary" , "rust_shared_library" ) 17load ( "@rules_rust//wasm_bindgen:wasm_bindgen.bzl" , "rust_wasm_bindgen" ) 18 19package ( default_visibility = [ "//visibility:public" ]) 20 21rust_binary ( 22name = "hello_world_bin_wasm" , 23srcs = [ "main.rs" ], 24edition = "2018" , 25deps = [ 26"@rules_rust//wasm_bindgen/3rdparty:wasm_bindgen" , 27], 28) 29 30rust_shared_library ( 31name = "hello_world_lib_wasm" , 32srcs = [ "main.rs" ], 33edition = "2018" , 34deps = [ 35"@rules_rust//wasm_bindgen/3rdparty:wasm_bindgen" , 36], 37) 38 39rust_wasm_bindgen ( 40name = "hello_world_bundler_wasm_bindgen" , 41wasm_file = ":hello_world_bin_wasm" , 42) 43 44rust_wasm_bindgen ( 45name = "hello_world_web_wasm_bindgen" , 46target = "web" , 47wasm_file = ":hello_world_lib_wasm" , 48) 49 50rust_wasm_bindgen ( 51name = "hello_world_deno_wasm_bindgen" , 52target = "deno" , 53wasm_file = ":hello_world_lib_wasm" , 54) 55 56rust_wasm_bindgen ( 57name = "hello_world_nomodules_wasm_bindgen" , 58target = "no-modules" , 59wasm_file = ":hello_world_lib_wasm" , 60) 61 62rust_wasm_bindgen ( 63name = "hello_world_nodejs_wasm_bindgen" , 64target = "nodejs" , 65wasm_file = ":hello_world_lib_wasm" , 66) 67 68nodejs_test ( 69name = "hello_world_wasm_test" , 70data = [ 71":hello_world_bundler_wasm_bindgen" , 72":hello_world_deno_wasm_bindgen" , 73":hello_world_nodejs_wasm_bindgen" , 74":hello_world_nomodules_wasm_bindgen" , 75":hello_world_web_wasm_bindgen" , 76], 77entry_point = "hello_world_wasm_test.js" , 78)