re-apply e84818

This commit is contained in:
James Salter 2015-05-30 16:46:38 +01:00
parent 34ac5845b0
commit 981928a2f4
2 changed files with 6 additions and 8 deletions

View File

@ -169,12 +169,11 @@ fn run_python_script(script: &str) -> Result<String, String> {
#[cfg(not(target_os="macos"))]
#[cfg(not(target_os="windows"))]
fn get_rustc_link_lib(version: &PythonVersion, enable_shared: bool) -> Result<String, String> {
let dotted_version = format!("{}.{}", version.major, version.minor.unwrap());
if enable_shared {
Ok(format!("cargo:rustc-link-lib=python{}.{}", version.major,
version.minor))
Ok(format!("cargo:rustc-link-lib=python{}", dotted_version))
} else {
Ok(format!("cargo:rustc-link-lib=static=python{}.{}", version.major,
version.minor))
Ok(format!("cargo:rustc-link-lib=static=python{}", dotted_version))
}
}

View File

@ -169,12 +169,11 @@ fn run_python_script(script: &str) -> Result<String, String> {
#[cfg(not(target_os="macos"))]
#[cfg(not(target_os="windows"))]
fn get_rustc_link_lib(version: &PythonVersion, enable_shared: bool) -> Result<String, String> {
let dotted_version = format!("{}.{}", version.major, version.minor.unwrap());
if enable_shared {
Ok(format!("cargo:rustc-link-lib=python{}.{}", version.major,
version.minor))
Ok(format!("cargo:rustc-link-lib=python{}", dotted_version));
} else {
Ok(format!("cargo:rustc-link-lib=static=python{}.{}", version.major,
version.minor))
Ok(format!("cargo:rustc-link-lib=static=python{}", dotted_version));
}
}