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]
name = "gcc"
version = "0.3.2"
version = "0.3.3"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/alexcrichton/gcc-rs"

20
src/lib.rs

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

Loading…
Cancel
Save