diff --git a/README.md b/README.md index 883cfe533..694bf2fad 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ cxx-build = "1.0" fn main() { cxx_build::bridge("src/main.rs") // returns a cc::Build .file("src/demo.cc") - .flag_if_supported("-std=c++11") + .std("c++11") .compile("cxxbridge-demo"); println!("cargo:rerun-if-changed=src/main.rs"); diff --git a/book/src/build/cargo.md b/book/src/build/cargo.md index 3d82baed1..6e9af8027 100644 --- a/book/src/build/cargo.md +++ b/book/src/build/cargo.md @@ -38,7 +38,7 @@ set up any additional source files and compiler flags as normal. fn main() { cxx_build::bridge("src/main.rs") // returns a cc::Build .file("src/demo.cc") - .flag_if_supported("-std=c++11") + .std("c++11") .compile("cxxbridge-demo"); println!("cargo:rerun-if-changed=src/main.rs"); diff --git a/book/src/tutorial.md b/book/src/tutorial.md index 9c1b5c2cd..cafa24d3c 100644 --- a/book/src/tutorial.md +++ b/book/src/tutorial.md @@ -159,7 +159,7 @@ std::unique_ptr new_blobstore_client() { } ``` -Using `std::make_unique` would work too, as long as you pass `-std=c++14` to the +Using `std::make_unique` would work too, as long as you pass `std("c++14")` to the C++ compiler as described later on. The placement in *include/* and *src/* is not significant; you can place C++ @@ -222,7 +222,7 @@ integration. # fn main() { cxx_build::bridge("src/main.rs") .file("src/blobstore.cc") - .flag_if_supported("-std=c++14") + .std("c++14") .compile("cxx-demo"); # } ```