fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
de4078af
main
1load ( "//rust:defs.bzl" , "rust_library" , "rust_proc_macro" , "rust_test" ) 2 3# Data of both :rust_proc_macro and :proc_macro_helper needs to be available at 4# build time (which is run-time of the procedural macros). 5rust_test ( 6name = "proc_macro_data_test" , 7srcs = [ "rust_test.rs" ], 8edition = "2021" , 9proc_macro_deps = [ 10":rust_proc_macro" , 11], 12deps = [ 13":nonmacro_library" , 14], 15) 16 17# Data of both :rust_proc_macro and :proc_macro_helper needs to be available. 18rust_library ( 19name = "nonmacro_library" , 20srcs = [ "nonmacro_library.rs" ], 21edition = "2021" , 22proc_macro_deps = [ 23":rust_proc_macro" , 24], 25) 26 27# No data needs to be available during this build. 28rust_proc_macro ( 29name = "rust_proc_macro" , 30srcs = [ "rust_proc_macro.rs" ], 31data = [ "proc_macro_data.txt" ], 32edition = "2021" , 33rustc_env = { "CARGO_MANIFEST_DIR" : package_name ()}, 34deps = [ 35":proc_macro_helper" , 36], 37) 38 39rust_library ( 40name = "proc_macro_helper" , 41srcs = [ "proc_macro_helper.rs" ], 42data = [ "helper_data.txt" ], 43edition = "2021" , 44rustc_env = { "CARGO_MANIFEST_DIR" : package_name ()}, 45)