| Matthew Maurer | 5a12fc8 | 2020-06-10 13:58:55 -0700 | [diff] [blame] | 1 | rust_library { |
| 2 | name: "libcxx", |
| 3 | crate_name: "cxx", |
| 4 | srcs: ["src/lib.rs"], |
| 5 | edition: "2018", |
| 6 | rustlibs: [ |
| 7 | "libanyhow", |
| 8 | "libthiserror", |
| 9 | ], |
| 10 | proc_macros: [ |
| 11 | "libcxxbridge_macro", |
| 12 | ], |
| 13 | static_libs: [ |
| 14 | "libcxxbridge03", |
| 15 | ], |
| 16 | shared_libs: ["libc++"], |
| 17 | } |
| 18 | |
| 19 | cc_library_static { |
| 20 | host_supported: true, |
| 21 | name: "libcxxbridge03", |
| 22 | cflags: ["-DRUST_CXX_NO_EXCEPTIONS"], |
| 23 | srcs: ["src/cxx.cc"] |
| 24 | } |
| 25 | |
| 26 | cc_library_static { |
| 27 | host_supported: true, |
| 28 | name: "libcxx-demo-cxx", |
| 29 | srcs: ["demo-cxx/demo.cc"], |
| 30 | local_include_dirs: ["demo-cxx"], |
| 31 | generated_headers: ["cxx-demo-bridge-header", "cxx-bridge-header"], |
| 32 | generated_sources: ["cxx-demo-bridge-code"], |
| 33 | } |
| 34 | |
| 35 | genrule { |
| 36 | name: "cxx-bridge-header", |
| 37 | tools: ["cxxbridge"], |
| 38 | cmd: "$(location cxxbridge) --header > $(out)", |
| 39 | out: ["rust/cxx.h"], |
| 40 | } |