| David Tolnay | c19936c | 2020-02-22 11:48:47 -0800 | [diff] [blame] | 1 | load("//:build/rust.bzl", "rust_binary", "rust_library") |
| 2 | |
| 3 | rust_library( |
| 4 | name = "cxx", |
| 5 | srcs = glob(["src/**/*.rs"]), |
| 6 | data = ["src/gen/include/cxxbridge.h"], |
| 7 | visibility = ["//visibility:public"], |
| 8 | deps = [ |
| 9 | ":core_lib", |
| 10 | ":cxxbridge_macro", |
| 11 | "//third-party:anyhow", |
| 12 | "//third-party:cc", |
| 13 | "//third-party:codespan", |
| 14 | "//third-party:codespan_reporting", |
| 15 | "//third-party:link_cplusplus", |
| 16 | "//third-party:proc_macro2", |
| 17 | "//third-party:quote", |
| 18 | "//third-party:syn", |
| 19 | "//third-party:thiserror", |
| 20 | ], |
| 21 | ) |
| 22 | |
| 23 | rust_binary( |
| 24 | name = "codegen", |
| 25 | srcs = glob(["cmd/src/**/*.rs"]), |
| 26 | data = ["cmd/src/gen/include/cxxbridge.h"], |
| 27 | visibility = ["//visibility:public"], |
| 28 | deps = [ |
| 29 | "//third-party:anyhow", |
| 30 | "//third-party:codespan", |
| 31 | "//third-party:codespan_reporting", |
| 32 | "//third-party:proc_macro2", |
| 33 | "//third-party:quote", |
| 34 | "//third-party:structopt", |
| 35 | "//third-party:syn", |
| 36 | "//third-party:thiserror", |
| 37 | ], |
| 38 | ) |
| 39 | |
| 40 | cc_library( |
| 41 | name = "core", |
| 42 | hdrs = ["include/cxxbridge.h"], |
| 43 | include_prefix = "cxxbridge", |
| 44 | strip_include_prefix = "include", |
| 45 | visibility = ["//visibility:public"], |
| 46 | ) |
| 47 | |
| 48 | cc_library( |
| 49 | name = "core_lib", |
| 50 | srcs = ["src/cxxbridge.cc"], |
| 51 | hdrs = ["include/cxxbridge.h"], |
| 52 | ) |
| 53 | |
| 54 | rust_library( |
| 55 | name = "cxxbridge_macro", |
| 56 | srcs = glob(["macro/src/**"]), |
| 57 | crate_type = "proc-macro", |
| 58 | deps = [ |
| 59 | "//third-party:proc_macro2", |
| 60 | "//third-party:quote", |
| 61 | "//third-party:syn", |
| 62 | ], |
| 63 | ) |