Skip to content

Commit

Permalink
Merge pull request #206 from opilar/feature/target-host-docs
Browse files Browse the repository at this point in the history
target/host examples in docs
  • Loading branch information
alexcrichton committed Jul 16, 2017
2 parents 4adb2bc + 14a70f0 commit 2b0d2be
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Expand Up @@ -374,6 +374,15 @@ impl Config {
///
/// This option is automatically scraped from the `TARGET` environment
/// variable by build scripts, so it's not required to call this function.
///
/// # Example
///
/// ```no_run
/// gcc::Config::new()
/// .file("src/foo.c")
/// .target("aarch64-linux-android")
/// .compile("libfoo.so");
/// ```
pub fn target(&mut self, target: &str) -> &mut Config {
self.target = Some(target.to_string());
self
Expand All @@ -383,6 +392,15 @@ impl Config {
///
/// This option is automatically scraped from the `HOST` environment
/// variable by build scripts, so it's not required to call this function.
///
/// # Example
///
/// ```no_run
/// gcc::Config::new()
/// .file("src/foo.c")
/// .host("arm-linux-gnueabihf")
/// .compile("libfoo.so");
/// ```
pub fn host(&mut self, host: &str) -> &mut Config {
self.host = Some(host.to_string());
self
Expand Down

0 comments on commit 2b0d2be

Please sign in to comment.