2020-09-24 12:56:48 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
2020-02-25 08:07:13 +00:00
|
|
|
load("//tools/bazel:rust.bzl", "rust_library", "rust_test")
|
2020-09-24 13:32:12 +00:00
|
|
|
load("//tools/bazel:rust_cxx_bridge.bzl", "rust_cxx_bridge")
|
2020-02-23 06:46:03 +00:00
|
|
|
|
|
|
|
rust_test(
|
|
|
|
name = "test",
|
2020-09-24 12:49:03 +00:00
|
|
|
size = "small",
|
2020-02-23 06:46:03 +00:00
|
|
|
srcs = ["test.rs"],
|
2020-10-12 23:32:54 +00:00
|
|
|
deps = [
|
|
|
|
":cxx_test_suite",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
2020-02-23 06:46:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
rust_library(
|
|
|
|
name = "cxx_test_suite",
|
2020-05-08 09:16:29 +00:00
|
|
|
srcs = [
|
2020-10-10 23:19:20 +00:00
|
|
|
"ffi/extra.rs",
|
2020-05-08 09:16:29 +00:00
|
|
|
"ffi/lib.rs",
|
|
|
|
"ffi/module.rs",
|
|
|
|
],
|
2020-02-23 06:46:03 +00:00
|
|
|
deps = [
|
|
|
|
":impl",
|
|
|
|
"//:cxx",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "impl",
|
|
|
|
srcs = [
|
|
|
|
"ffi/tests.cc",
|
2020-09-22 05:39:42 +00:00
|
|
|
":bridge/source",
|
2020-10-10 23:19:20 +00:00
|
|
|
":extra/source",
|
2020-10-10 23:29:58 +00:00
|
|
|
":module/source",
|
2020-02-23 06:46:03 +00:00
|
|
|
],
|
|
|
|
hdrs = ["ffi/tests.h"],
|
|
|
|
deps = [
|
2020-09-22 05:39:42 +00:00
|
|
|
":bridge/include",
|
2020-02-23 06:46:03 +00:00
|
|
|
"//:core",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-09-24 13:32:12 +00:00
|
|
|
rust_cxx_bridge(
|
|
|
|
name = "bridge",
|
|
|
|
src = "ffi/lib.rs",
|
|
|
|
deps = [":impl"],
|
2020-02-23 06:46:03 +00:00
|
|
|
)
|
2020-05-08 09:16:29 +00:00
|
|
|
|
2020-09-24 13:32:12 +00:00
|
|
|
rust_cxx_bridge(
|
2020-10-10 23:29:58 +00:00
|
|
|
name = "extra",
|
|
|
|
src = "ffi/extra.rs",
|
2020-09-24 13:32:12 +00:00
|
|
|
deps = [":impl"],
|
2020-05-08 09:16:29 +00:00
|
|
|
)
|
2020-10-10 23:19:20 +00:00
|
|
|
|
|
|
|
rust_cxx_bridge(
|
2020-10-10 23:29:58 +00:00
|
|
|
name = "module",
|
|
|
|
src = "ffi/module.rs",
|
2020-10-10 23:19:20 +00:00
|
|
|
deps = [":impl"],
|
|
|
|
)
|