diff --git a/BUCK b/BUCK index 2c601399..0dfa11b8 100644 --- a/BUCK +++ b/BUCK @@ -6,7 +6,6 @@ rust_library( deps = [ ":core", ":macro", - "//third-party:link-cplusplus", ], ) diff --git a/BUILD b/BUILD index 02481733..27c69319 100644 --- a/BUILD +++ b/BUILD @@ -7,10 +7,7 @@ rust_library( ":cxxbridge-macro", ], visibility = ["//visibility:public"], - deps = [ - ":core-lib", - "//third-party:link-cplusplus", - ], + deps = [":core-lib"], ) rust_binary( diff --git a/build.rs b/build.rs index 2aad99f4..cecf0e51 100644 --- a/build.rs +++ b/build.rs @@ -7,4 +7,5 @@ fn main() { .compile("cxxbridge03"); println!("cargo:rerun-if-changed=src/cxx.cc"); println!("cargo:rerun-if-changed=include/cxx.h"); + println!("cargo:rustc-cfg=built_with_cargo"); } diff --git a/src/lib.rs b/src/lib.rs index dc26f67d..4053c85c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -368,6 +368,7 @@ clippy::useless_let_if_seq )] +#[cfg(built_with_cargo)] extern crate link_cplusplus; #[macro_use] diff --git a/third-party/BUCK b/third-party/BUCK index 95c879af..86e8e72d 100644 --- a/third-party/BUCK +++ b/third-party/BUCK @@ -38,12 +38,6 @@ rust_library( srcs = glob(["vendor/lazy_static-1.4.0/src/**"]), ) -rust_library( - name = "link-cplusplus", - srcs = glob(["vendor/link-cplusplus-1.0.2/src/**"]), - visibility = ["PUBLIC"], -) - rust_library( name = "proc-macro2", srcs = glob(["vendor/proc-macro2-1.0.19/src/**"]), diff --git a/third-party/BUILD b/third-party/BUILD index 081737ea..7ceec9b5 100644 --- a/third-party/BUILD +++ b/third-party/BUILD @@ -43,12 +43,6 @@ rust_library( srcs = glob(["vendor/lazy_static-1.4.0/src/**"]), ) -rust_library( - name = "link-cplusplus", - srcs = glob(["vendor/link-cplusplus-1.0.2/src/**"]), - visibility = ["//visibility:public"], -) - rust_library( name = "proc-macro2", srcs = glob(["vendor/proc-macro2-1.0.19/src/**"]),