| 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++"], |
| Zach Johnson | c95654c | 2020-11-18 12:51:57 -0800 | [diff] [blame^] | 17 | host_supported: true, |
| Matthew Maurer | 5a12fc8 | 2020-06-10 13:58:55 -0700 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | cc_library_static { |
| 21 | host_supported: true, |
| 22 | name: "libcxxbridge03", |
| 23 | cflags: ["-DRUST_CXX_NO_EXCEPTIONS"], |
| 24 | srcs: ["src/cxx.cc"] |
| 25 | } |
| 26 | |
| 27 | cc_library_static { |
| 28 | host_supported: true, |
| 29 | name: "libcxx-demo-cxx", |
| 30 | srcs: ["demo-cxx/demo.cc"], |
| 31 | local_include_dirs: ["demo-cxx"], |
| 32 | generated_headers: ["cxx-demo-bridge-header", "cxx-bridge-header"], |
| 33 | generated_sources: ["cxx-demo-bridge-code"], |
| 34 | } |
| 35 | |
| 36 | genrule { |
| 37 | name: "cxx-bridge-header", |
| 38 | tools: ["cxxbridge"], |
| 39 | cmd: "$(location cxxbridge) --header > $(out)", |
| 40 | out: ["rust/cxx.h"], |
| 41 | } |