1import("//build/rust/rust_static_library.gni") 2 3static_library("cpp_library") { 4 sources = [ 5 "cpp_library.cc", 6 "cpp_library.h", 7 ] 8} 9 10rust_static_library("rust_calling_cpp_rlib") { 11 sources = [ "rust_calling_cpp_rlib.rs" ] 12 crate_root = "rust_calling_cpp_rlib.rs" 13 cxx_bindings = [ "rust_calling_cpp_rlib.rs" ] 14 allow_unsafe = true 15 deps = [ ":cpp_library" ] 16} 17 18executable("test_rust_calling_cpp") { 19 deps = [ ":rust_calling_cpp_rlib" ] 20 sources = [ "main.cc" ] 21} 22