fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
559d41ac
0.9.0
1load ( "@rules_rust//rust:defs.bzl" , "rust_doc" , "rust_library" , "rust_test" ) 2 3package ( default_visibility = [ "//ffi/rust_calling_c:__subpackages__" ]) 4 5rust_library ( 6name = "matrix" , 7srcs = [ 8"src/ffi.rs" , 9"src/matrix.rs" , 10], 11deps = [ 12"//ffi/rust_calling_c/c:native_matrix" , 13"@libc" , 14], 15) 16 17rust_test ( 18name = "matrix_test" , 19crate = ":matrix" , 20) 21 22rust_doc ( 23name = "matrix_doc" , 24crate = ":matrix" , 25) 26 27## Do the same as above, but with a dynamic c library. 28 29rust_library ( 30name = "matrix_dynamically_linked" , 31srcs = [ 32"src/ffi.rs" , 33"src/matrix.rs" , 34], 35crate_root = "src/matrix.rs" , 36target_compatible_with = select ({ 37# TODO: Make this work on windows 38"@platforms//os:windows" : [ "@platforms//:incompatible" ], 39"//conditions:default" : [], 40}), 41deps = [ 42"//ffi/rust_calling_c/c:native_matrix_so" , 43"@libc" , 44], 45) 46 47rust_test ( 48name = "matrix_dylib_test" , 49crate = ":matrix_dynamically_linked" , 50target_compatible_with = select ({ 51# TODO: This test requires --incompatible_macos_set_install_name and Bazel 4.2.0+ 52"@platforms//os:macos" : [ "@platforms//:incompatible" ], 53# TODO: Make this work on windows 54"@platforms//os:windows" : [ "@platforms//:incompatible" ], 55"//conditions:default" : [], 56}), 57) 58 59rust_doc ( 60name = "matrix_dylib_doc" , 61crate = ":matrix_dynamically_linked" , 62)