Skip to content

Commit 9f6c075

Browse files
committed
Inline cxx-symbols crate into cxx
The separation is no longer needed for Buck when linking with lld.
1 parent 7aa5e21 commit 9f6c075

File tree

14 files changed

+13
-62
lines changed

14 files changed

+13
-62
lines changed

BUCK

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
rust_library(
22
name = "cxx",
3-
srcs = glob(["src/**"], exclude = ["src/symbols/**"]),
3+
srcs = glob(["src/**"]),
44
visibility = ["PUBLIC"],
55
deps = [
66
":core",
77
":macro",
8-
":symbols",
98
],
109
)
1110

@@ -32,12 +31,6 @@ cxx_library(
3231
"cxx.h": "include/cxx.h",
3332
},
3433
exported_linker_flags = ["-lstdc++"],
35-
deps = [":symbols"],
36-
)
37-
38-
rust_library(
39-
name = "symbols",
40-
srcs = glob(["src/symbols/**"]),
4134
)
4235

4336
rust_library(

BUILD

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ load("//tools/bazel:rust.bzl", "rust_binary", "rust_library")
22

33
rust_library(
44
name = "cxx",
5-
srcs = glob(
6-
["src/**/*.rs"],
7-
exclude = ["src/symbols/**/*.rs"],
8-
),
5+
srcs = glob(["src/**/*.rs"]),
96
proc_macro_deps = [
107
":cxxbridge-macro",
118
],
129
visibility = ["//visibility:public"],
13-
deps = [
14-
":core-lib",
15-
":symbols",
16-
],
10+
deps = [":core-lib"],
1711
)
1812

1913
rust_binary(
@@ -44,11 +38,6 @@ cc_library(
4438
hdrs = ["include/cxx.h"],
4539
)
4640

47-
rust_library(
48-
name = "symbols",
49-
srcs = glob(["src/symbols/**/*.rs"]),
50-
)
51-
5241
rust_library(
5342
name = "cxxbridge-macro",
5443
srcs = glob(["macro/src/**"]),

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ default = ["cxxbridge-flags/default"] # c++11
2020
"c++20" = ["cxxbridge-flags/c++20"]
2121

2222
[dependencies]
23-
cxx-symbols = { version = "=0.4.3", path = "src/symbols" }
2423
cxxbridge-macro = { version = "=0.4.3", path = "macro" }
2524
link-cplusplus = "1.0"
2625

@@ -35,7 +34,7 @@ rustversion = "1.0"
3534
trybuild = { version = "1.0.33", features = ["diff"] }
3635

3736
[workspace]
38-
members = ["demo", "flags", "gen/build", "gen/cmd", "gen/lib", "macro", "src/symbols", "tests/ffi"]
37+
members = ["demo", "flags", "gen/build", "gen/cmd", "gen/lib", "macro", "tests/ffi"]
3938

4039
[package.metadata.docs.rs]
4140
targets = ["x86_64-unknown-linux-gnu"]

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,9 @@
369369

370370
#[cfg(built_with_cargo)]
371371
extern crate link_cplusplus;
372+
372373
#[macro_use]
373-
extern crate symbols;
374+
mod macros;
374375

375376
mod cxx_string;
376377
mod cxx_vector;
@@ -383,6 +384,7 @@ mod rust_sliceu8;
383384
mod rust_str;
384385
mod rust_string;
385386
mod rust_vec;
387+
mod symbols;
386388
mod unique_ptr;
387389
mod unwind;
388390

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/rust_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::mem::ManuallyDrop;
33

44
#[repr(C)]
55
pub struct RustVec<T> {
6-
repr: Vec<T>,
6+
pub(crate) repr: Vec<T>,
77
}
88

99
impl<T> RustVec<T> {

src/symbols/Cargo.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/symbols/lib.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)