blob: 6858f6cb309e2393d9f8fda1affd48042c85f364 [file] [log] [blame]
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_rust//rust:defs.bzl", "rust_library")
rust_library(
name = "cxx",
srcs = glob(["src/**/*.rs"]),
crate_features = [
"alloc",
"std",
],
edition = "2018",
proc_macro_deps = [
"@cxx_deps//:cxxbridge-macro",
],
visibility = ["//visibility:public"],
deps = [":core-lib"],
)
config_setting(
name = "linux_x64",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
)
cc_library(
name = "core-lib",
srcs = [
"src/cxx.cc",
] + select(
{
":linux_x64": ["@clang_linux_amd64//:link_libs"],
"//conditions:default": [],
},
),
hdrs = ["include/cxx.h"],
)