Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame] | 1 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") |
| 2 | load("//bindgen:bindgen.bzl", "rust_bindgen_toolchain") |
| 3 | |
| 4 | package(default_visibility = ["//visibility:public"]) |
| 5 | |
Brian Silverman | 5f6f276 | 2022-08-13 19:30:05 -0700 | [diff] [blame^] | 6 | toolchain_type( |
| 7 | name = "toolchain_type", |
Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | alias( |
Brian Silverman | 5f6f276 | 2022-08-13 19:30:05 -0700 | [diff] [blame^] | 11 | name = "bindgen_toolchain", |
| 12 | actual = "toolchain_type", |
| 13 | deprecation = "instead use `@rules_rust//bindgen:toolchain_type`", |
| 14 | tags = ["manual"], |
| 15 | ) |
| 16 | |
| 17 | bzl_library( |
| 18 | name = "bzl_lib", |
| 19 | srcs = glob(["**/*.bzl"]), |
| 20 | deps = [ |
| 21 | "//bindgen/3rdparty:bzl_lib", |
| 22 | "//rust:bzl_lib", |
| 23 | ], |
Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame] | 24 | ) |
| 25 | |
| 26 | rust_bindgen_toolchain( |
| 27 | name = "default_bindgen_toolchain_impl", |
Brian Silverman | 5f6f276 | 2022-08-13 19:30:05 -0700 | [diff] [blame^] | 28 | bindgen = "//bindgen/3rdparty:bindgen", |
Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame] | 29 | clang = select({ |
| 30 | "//rust/platform:osx": "@bindgen_clang_osx//:clang", |
| 31 | "//conditions:default": "@bindgen_clang_linux//:clang", |
| 32 | }), |
| 33 | libclang = select({ |
| 34 | "//rust/platform:osx": "@bindgen_clang_osx//:libclang", |
| 35 | "//conditions:default": "@bindgen_clang_linux//:libclang", |
| 36 | }), |
| 37 | libstdcxx = select({ |
| 38 | "//rust/platform:osx": "@bindgen_clang_osx//:libc++", |
| 39 | "//conditions:default": None, |
| 40 | }), |
| 41 | ) |
| 42 | |
| 43 | toolchain( |
| 44 | name = "default_bindgen_toolchain", |
| 45 | toolchain = "default_bindgen_toolchain_impl", |
Brian Silverman | 5f6f276 | 2022-08-13 19:30:05 -0700 | [diff] [blame^] | 46 | toolchain_type = "//bindgen:toolchain_type", |
Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame] | 47 | ) |