diff --git a/Cargo.toml b/Cargo.toml index 3280daea5..57b432037 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ cxxbridge-flags = { version = "=0.4.7", path = "flags", default-features = false [dev-dependencies] cxx-build = { version = "=0.4.7", path = "gen/build" } cxx-test-suite = { version = "0", path = "tests/ffi" } -cxxbridge-flags = { version = "=0.4.7", path = "flags", default-features = false } rustversion = "1.0" trybuild = { version = "1.0.33", features = ["diff"] } diff --git a/README.md b/README.md index be1478bfb..f4f41c00e 100644 --- a/README.md +++ b/README.md @@ -212,10 +212,10 @@ For builds that are orchestrated by Cargo, you will use a build script that runs CXX's C++ code generator and compiles the resulting C++ code along with any other C++ code for your crate. -Set CXX features such as support of a different C++ standard - default is -C++11 - by setting the feature on the CXX crate. This ensures that the CXX -bridge library code in cxx.h|cc gets compiled with the same feature flags -as your code. +CXX create features, such as support of a different C++ standard, are +automatically set if using cxx_build. This ensures that your code gets +compiled with the same feature flags as the CXX bridge library code in +cxx.h|cc. See the CXX crate for available features. The canonical build script is as follows. The indicated line returns a [`cc::Build`] instance (from the usual widely used `cc` crate) on which you can @@ -233,7 +233,6 @@ cxx = "0.4" [build-dependencies] cxx-build = "0.4" -cxxbridge-flags = "0.4" ``` ```rust @@ -242,7 +241,6 @@ cxxbridge-flags = "0.4" fn main() { cxx_build::bridge("src/main.rs") // returns a cc::Build .file("src/demo.cc") - .flag_if_supported(cxxbridge_flags::STD) .compile("cxxbridge-demo"); println!("cargo:rerun-if-changed=src/main.rs"); diff --git a/gen/build/src/lib.rs b/gen/build/src/lib.rs index fb029b82b..1007c395e 100644 --- a/gen/build/src/lib.rs +++ b/gen/build/src/lib.rs @@ -4,10 +4,10 @@ //! C++ code generator, set up any additional compiler flags depending on //! the use case, and make the C++ compiler invocation. //! -//! Set CXX features such as support of a different C++ standard - default is -//! C++11 - by setting the feature on the CXX crate. This ensures that the CXX -//! bridge library code in cxx.h|cc gets compiled with the same feature flags -//! as your code. +//! CXX create features, such as support of a different C++ standard, are +//! automatically set if using cxx_build. This ensures that your code gets +//! compiled with the same feature flags as the CXX bridge library code in +//! cxx.h|cc. See the CXX crate for available features. //! //!
//! @@ -21,7 +21,6 @@ //! fn main() { //! cxx_build::bridge("src/main.rs") //! .file("src/demo.cc") -//! .flag_if_supported(cxxbridge_flags::STD) //! .compile("cxxbridge-demo"); //! //! println!("cargo:rerun-if-changed=src/main.rs"); @@ -92,7 +91,6 @@ pub fn bridge(rust_source_file: impl AsRef) -> Build { /// let source_files = vec!["src/main.rs", "src/path/to/other.rs"]; /// cxx_build::bridges(source_files) /// .file("src/demo.cc") -/// .flag_if_supported(cxxbridge_flags::STD) /// .compile("cxxbridge-demo"); /// ``` #[must_use] diff --git a/src/lib.rs b/src/lib.rs index f6060a510..156d57f0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -218,10 +218,10 @@ //! runs CXX's C++ code generator and compiles the resulting C++ code along with //! any other C++ code for your crate. //! -//! Set CXX features such as support of a different C++ standard - default is -//! C++11 - by setting the feature on the CXX crate. This ensures that the CXX -//! bridge library code in cxx.h|cc gets compiled with the same feature flags -//! as your code. +//! CXX create features, such as support of a different C++ standard, are +//! automatically set if using cxx_build. This ensures that your code gets +//! compiled with the same feature flags as the CXX bridge library code in +//! cxx.h|cc. See the CXX crate for available features. //! //! The canonical build script is as follows. The indicated line returns a //! [`cc::Build`] instance (from the usual widely used `cc` crate) on which you @@ -239,7 +239,6 @@ //! //! [build-dependencies] //! cxx-build = "0.4" -//! cxxbridge-flags = "0.4" //! ``` //! //! ```no_run @@ -248,7 +247,6 @@ //! fn main() { //! cxx_build::bridge("src/main.rs") // returns a cc::Build //! .file("src/demo.cc") -//! .flag_if_supported(cxxbridge_flags::STD) //! .compile("cxxbridge-demo"); //! //! println!("cargo:rerun-if-changed=src/main.rs"); diff --git a/third-party/Cargo.lock b/third-party/Cargo.lock index e536ae3fc..d2b62038b 100644 --- a/third-party/Cargo.lock +++ b/third-party/Cargo.lock @@ -78,6 +78,7 @@ dependencies = [ "cc", "codespan-reporting", "cxx-gen", + "cxxbridge-flags", "proc-macro2", "quote", "syn", @@ -100,7 +101,6 @@ version = "0.0.0" dependencies = [ "cxx", "cxx-build", - "cxxbridge-flags", ] [[package]] @@ -134,7 +134,6 @@ version = "0.0.0" dependencies = [ "cxx", "cxx-build", - "cxxbridge-flags", ] [[package]]