1export_file( 2 name = ".clippy.toml", 3 visibility = ["toolchains//:rust"], 4) 5 6rust_library( 7 name = "cxx", 8 srcs = glob(["src/**/*.rs"]), 9 doc_deps = [ 10 ":cxx-build", 11 ], 12 edition = "2018", 13 features = [ 14 "alloc", 15 "std", 16 ], 17 visibility = ["PUBLIC"], 18 deps = [ 19 ":core", 20 ":cxxbridge-macro", 21 ], 22) 23 24alias( 25 name = "codegen", 26 actual = ":cxxbridge", 27 visibility = ["PUBLIC"], 28) 29 30rust_binary( 31 name = "cxxbridge", 32 srcs = glob(["gen/cmd/src/**/*.rs"]) + [ 33 "gen/cmd/src/gen", 34 "gen/cmd/src/syntax", 35 ], 36 edition = "2018", 37 deps = [ 38 "//third-party:clap", 39 "//third-party:codespan-reporting", 40 "//third-party:proc-macro2", 41 "//third-party:quote", 42 "//third-party:syn", 43 ], 44) 45 46cxx_library( 47 name = "core", 48 srcs = ["src/cxx.cc"], 49 exported_headers = { 50 "cxx.h": "include/cxx.h", 51 }, 52 header_namespace = "rust", 53 preferred_linkage = "static", 54 visibility = ["PUBLIC"], 55) 56 57rust_library( 58 name = "cxxbridge-macro", 59 srcs = glob(["macro/src/**/*.rs"]) + ["macro/src/syntax"], 60 doctests = False, 61 edition = "2018", 62 proc_macro = True, 63 deps = [ 64 "//third-party:proc-macro2", 65 "//third-party:quote", 66 "//third-party:syn", 67 ], 68) 69 70rust_library( 71 name = "cxx-build", 72 srcs = glob(["gen/build/src/**/*.rs"]) + [ 73 "gen/build/src/gen", 74 "gen/build/src/syntax", 75 ], 76 doctests = False, 77 edition = "2018", 78 deps = [ 79 "//third-party:cc", 80 "//third-party:codespan-reporting", 81 "//third-party:once_cell", 82 "//third-party:proc-macro2", 83 "//third-party:quote", 84 "//third-party:scratch", 85 "//third-party:syn", 86 ], 87) 88 89rust_library( 90 name = "cxx-gen", 91 srcs = glob(["gen/lib/src/**/*.rs"]) + [ 92 "gen/lib/src/gen", 93 "gen/lib/src/syntax", 94 ], 95 edition = "2018", 96 visibility = ["PUBLIC"], 97 deps = [ 98 "//third-party:cc", 99 "//third-party:codespan-reporting", 100 "//third-party:proc-macro2", 101 "//third-party:quote", 102 "//third-party:syn", 103 ], 104) 105