From aaa4e96c3e63ddb90b37d005c8be163a7a6fc27e Mon Sep 17 00:00:00 2001 From: opilarium Date: Sun, 16 Jul 2017 01:05:30 +0300 Subject: [PATCH] cpp_link_stdlib/cpp_set_stdlib examples --- src/lib.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7aab3ae..f737dff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -329,6 +329,16 @@ impl Config { /// otherwise cargo will link against the specified library. /// /// The given library name must not contain the `lib` prefix. + /// + /// # Example + /// + /// ```no_run + /// gcc::Config::new() + /// .file("src/foo.c") + /// .shared_flag(true) + /// .cpp_set_stdlib(Some("stdc++")) + /// .compile("libfoo.so"); + /// ``` pub fn cpp_link_stdlib(&mut self, cpp_link_stdlib: Option<&str>) -> &mut Config { self.cpp_link_stdlib = Some(cpp_link_stdlib.map(|s| s.into())); self @@ -354,6 +364,16 @@ impl Config { /// be used, otherwise `-stdlib` is added to the compile invocation. /// /// The given library name must not contain the `lib` prefix. + /// + /// # Example + /// + /// ```no_run + /// gcc::Config::new() + /// .file("src/foo.c") + /// .shared_flag(true) + /// .cpp_set_stdlib(Some("c++")) + /// .compile("libfoo.so"); + /// ``` pub fn cpp_set_stdlib(&mut self, cpp_set_stdlib: Option<&str>) -> &mut Config { self.cpp_set_stdlib = cpp_set_stdlib.map(|s| s.into()); self.cpp_link_stdlib(cpp_set_stdlib);