Skip to content

Commit

Permalink
Disable shared library for <3.3.0
Browse files Browse the repository at this point in the history
See #122 for details.
  • Loading branch information
nbigaouette committed Jan 13, 2020
1 parent 65c7f8f commit b1b7ba5
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/commands/install/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{

use anyhow::Context;
use flate2::read::GzDecoder;
#[cfg(target_os = "macos")]
use semver::Version;
use tar::Archive;

Expand Down Expand Up @@ -84,8 +83,28 @@ pub fn compile_source(
anyhow::anyhow!("Error converting install dir {:?} to `str`", install_dir)
})?
.to_string(),
"--enable-shared".to_string(),
];
if *version >= Version::new(3, 3, 0) {
configure_args.push("--enable-shared".to_string());
} else {
log::warn!("Python <3.3.0 seems to have issue compiling with '--enable-shared'.");
log::warn!(
"As such, version {} will not be compiled with shared library support",
version
);
log::warn!(
"and 'libpython{}.{}{}.{}' will not be available.",
version.major,
version.minor,
if release { "" } else { "m" },
if cfg!(target_os = "macos") {
"dylib"
} else {
"so"
}
);
log::warn!("See https://github.com/nbigaouette/pycors/issues/122 for more information.")
}
if release {
configure_args.push("--enable-optimizations".to_string());
}
Expand Down

0 comments on commit b1b7ba5

Please sign in to comment.