fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
5591596e
main
1load ( "@rules_cc//cc:defs.bzl" , "cc_library" ) 2load ( "@rules_rust//rust:defs.bzl" , "rust_binary" ) 3 4# A rust_binary that depends on two native libs with the same name. 5# See https://github.com/bazelbuild/rules_rust/issues/840. 6rust_binary ( 7name = "bin_with_same_name_deps" , 8srcs = [ "bin.rs" ], 9deps = [ 10"//ambiguous_deps/x:exc" , 11"//ambiguous_deps/y:exc" , 12], 13) 14 15# A rust_binary that depends on a native library with a name that doesn't 16# match the `lib<name>.a` pattern on linux. 17rust_binary ( 18name = "nonstandard_name_bin" , 19srcs = [ "nonstandard_name_bin.rs" ], 20deps = [ ":nonstandard_name_intermediate" ], 21) 22 23cc_library ( 24name = "nonstandard_name_cc_lib" , 25srcs = [ "cc_library_with_func.cc" ], 26) 27 28genrule ( 29name = "nonstandard_name_gen" , 30srcs = [ ":nonstandard_name_cc_lib" ], 31outs = [ "nonstandard_name_gen.a" ], 32# Copy the first member (libnonstandard_name_cc_lib.a) from the srcs to the 33# output nonstandard_name_gen.a. 34cmd = "cp $$(awk '{print $$1}' <<< '$(SRCS)') $@" , 35) 36 37cc_library ( 38name = "nonstandard_name_intermediate" , 39srcs = [ ":nonstandard_name_gen.a" ], 40)