Skip to content

Commit 0a978d5

Browse files
authored
[workerd-cxx] cleanup core library (#48)
I want to switch downstream from generated headers to direct bazel target consumption.
1 parent a5da0e6 commit 0a978d5

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

BUILD.bazel

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust_library(
1414
],
1515
visibility = ["//visibility:public"],
1616
deps = [
17-
":core-lib",
17+
":core",
1818
"@crates.io//:foldhash",
1919
],
2020
)
@@ -70,19 +70,14 @@ rust_binary(
7070

7171
cc_library(
7272
name = "core",
73+
srcs = ["src/cxx.cc"],
7374
hdrs = ["include/cxx.h"],
7475
include_prefix = "rust",
76+
linkstatic = True,
7577
strip_include_prefix = "include",
7678
visibility = ["//visibility:public"],
7779
)
7880

79-
cc_library(
80-
name = "core-lib",
81-
srcs = ["src/cxx.cc"],
82-
hdrs = ["include/cxx.h"],
83-
linkstatic = True,
84-
)
85-
8681
rust_proc_macro(
8782
name = "cxxbridge-macro",
8883
srcs = glob(["macro/src/*.rs"]),
@@ -141,4 +136,4 @@ platform(
141136
"@platforms//os:windows",
142137
"@bazel_tools//tools/cpp:clang-cl",
143138
],
144-
)
139+
)

kj-rs/BUILD.bazel

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,8 @@ rust_cxx_bridge(
3535
hdrs = glob(["*.h"]),
3636
include_prefix = "kj-rs",
3737
deps = [
38-
":cxx",
3938
"@capnp-cpp//src/kj:kj",
4039
"@capnp-cpp//src/kj:kj-async",
41-
"@workerd-cxx//:cxx",
40+
"@workerd-cxx//:core",
4241
],
4342
)
44-
45-
genrule(
46-
name = "cxx/generated",
47-
outs = ["cxx.h"],
48-
cmd = "$(location @workerd-cxx//:codegen) --header > \"$@\"",
49-
tools = ["@workerd-cxx//:codegen"],
50-
)
51-
52-
cc_library(
53-
name = "cxx",
54-
hdrs = ["cxx.h"],
55-
include_prefix = "rust",
56-
)

0 commit comments

Comments
 (0)