diff options
| author | Steven Fackler <[email protected]> | 2016-08-09 21:58:48 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-08-09 22:02:49 -0700 |
| commit | 0854632ff5c5c340e3300951dd06a767a16b11db (patch) | |
| tree | 14f59dd5701032070c1f17c3c5eab43d8e72a67e /openssl/build.rs | |
| parent | Remove rust_SSL_clone (diff) | |
| download | rust-openssl-0854632ff5c5c340e3300951dd06a767a16b11db.tar.xz rust-openssl-0854632ff5c5c340e3300951dd06a767a16b11db.zip | |
Make c_helpers optional
Diffstat (limited to 'openssl/build.rs')
| -rw-r--r-- | openssl/build.rs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/openssl/build.rs b/openssl/build.rs index 640b024c..b07c1b3e 100644 --- a/openssl/build.rs +++ b/openssl/build.rs @@ -1,16 +1,28 @@ -extern crate gcc; +#[cfg(feature = "c_helpers")] +mod imp { + extern crate gcc; -use std::env; -use std::path::PathBuf; + use std::env; + use std::path::PathBuf; -fn main() { - let mut config = gcc::Config::new(); + pub fn main() { + let mut config = gcc::Config::new(); - if let Some(paths) = env::var_os("DEP_OPENSSL_INCLUDE") { - for path in env::split_paths(&paths) { - config.include(PathBuf::from(path)); + if let Some(paths) = env::var_os("DEP_OPENSSL_INCLUDE") { + for path in env::split_paths(&paths) { + config.include(PathBuf::from(path)); + } } + + config.file("src/c_helpers.c").compile("libc_helpers.a"); } +} - config.file("src/c_helpers.c").compile("libc_helpers.a"); +#[cfg(not(feature = "c_helpers"))] +mod imp { + pub fn main() {} +} + +fn main() { + imp::main() } |