Browse Source

Bump to 0.3.3

add-rc-path 0.3.3
Alex Crichton 10 years ago
parent
commit
13f5fc28d1
  1. 2
      Cargo.toml
  2. 20
      src/lib.rs

2
Cargo.toml

@ -1,7 +1,7 @@
[package] [package]
name = "gcc" name = "gcc"
version = "0.3.2" version = "0.3.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"] authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
repository = "https://github.com/alexcrichton/gcc-rs" repository = "https://github.com/alexcrichton/gcc-rs"

20
src/lib.rs

@ -43,13 +43,13 @@
//! ``` //! ```
#![doc(html_root_url = "http://alexcrichton.com/gcc-rs")] #![doc(html_root_url = "http://alexcrichton.com/gcc-rs")]
#![feature(std_misc)] #![feature(convert)]
#![cfg_attr(test, deny(warnings))] #![cfg_attr(test, deny(warnings))]
use std::env; use std::env;
use std::fs; use std::fs;
use std::io; use std::io;
use std::path::{PathBuf, AsPath}; use std::path::{PathBuf, Path};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
/// Extra configuration to pass to gcc. /// Extra configuration to pass to gcc.
@ -110,8 +110,8 @@ impl Config {
} }
/// Add a directory to the `-I` or include path for headers /// Add a directory to the `-I` or include path for headers
pub fn include<P: AsPath>(&mut self, dir: P) -> &mut Config { pub fn include<P: AsRef<Path>>(&mut self, dir: P) -> &mut Config {
self.include_directories.push(dir.as_path().to_path_buf()); self.include_directories.push(dir.as_ref().to_path_buf());
self self
} }
@ -122,8 +122,8 @@ impl Config {
} }
/// Add an arbitrary object file to link in /// Add an arbitrary object file to link in
pub fn object<P: AsPath>(&mut self, obj: P) -> &mut Config { pub fn object<P: AsRef<Path>>(&mut self, obj: P) -> &mut Config {
self.objects.push(obj.as_path().to_path_buf()); self.objects.push(obj.as_ref().to_path_buf());
self self
} }
@ -134,8 +134,8 @@ impl Config {
} }
/// Add a file which will be compiled /// Add a file which will be compiled
pub fn file<P: AsPath>(&mut self, p: P) -> &mut Config { pub fn file<P: AsRef<Path>>(&mut self, p: P) -> &mut Config {
self.files.push(p.as_path().to_path_buf()); self.files.push(p.as_ref().to_path_buf());
self self
} }
@ -147,8 +147,8 @@ impl Config {
assert!(output.ends_with(".a")); assert!(output.ends_with(".a"));
let target = getenv_unwrap("TARGET"); let target = getenv_unwrap("TARGET");
let src = PathBuf::new(&getenv_unwrap("CARGO_MANIFEST_DIR")); let src = PathBuf::from(getenv_unwrap("CARGO_MANIFEST_DIR"));
let dst = PathBuf::new(&getenv_unwrap("OUT_DIR")); let dst = PathBuf::from(getenv_unwrap("OUT_DIR"));
let mut objects = Vec::new(); let mut objects = Vec::new();
for file in self.files.iter() { for file in self.files.iter() {
let mut cmd = self.gcc(); let mut cmd = self.gcc();

Loading…
Cancel
Save