fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
1b0672cc
0.9.0
1load ( "@rules_cc//cc:defs.bzl" , "cc_binary" , "cc_import" , "cc_library" , "cc_test" ) 2 3package ( default_visibility = [ "//ffi/rust_calling_c:__subpackages__" ]) 4 5cc_library ( 6name = "native_matrix" , 7srcs = [ "matrix.c" ], 8hdrs = [ "matrix.h" ], 9copts = [ "-std=c99" ], 10) 11 12cc_test ( 13name = "native_matrix_test" , 14srcs = [ "matrix_test.c" ], 15copts = [ "-std=c99" ], 16linkstatic = 1 , 17deps = [ 18":native_matrix" , 19], 20) 21 22## Do the same as above, but with a dynamic c library. 23 24cc_import ( 25name = "native_matrix_so" , 26hdrs = [ "matrix.h" ], 27shared_library = ":libnative_matrix_so.so" , 28) 29 30cc_binary ( 31name = "libnative_matrix_so.so" , 32srcs = [ 33"matrix.c" , 34"matrix.h" , 35], 36copts = [ "-std=c99" ], 37linkshared = True , 38)