Skip to content
Snippets Groups Projects
Commit 5adb3f39 authored by Quentin Baradat's avatar Quentin Baradat
Browse files

Fix the target for windows

parent ee66da60
Branches
Tags
No related merge requests found
...@@ -15,12 +15,10 @@ fn main() { ...@@ -15,12 +15,10 @@ fn main() {
(instructions in the README) and provide their location through \ (instructions in the README) and provide their location through \
$OPENSSL_PATH."); $OPENSSL_PATH.");
println!("cargo:rustc-flags=-L native={} -l crypto:static -l ssl:static", path); println!("cargo:rustc-flags=-L native={} -l crypto:static -l ssl:static", path);
// going to assume the user built a new version of openssl
build_old_openssl_shim(false);
return; return;
} }
if target.contains("win32") || target.contains("win64") { if target.contains("win32") || target.contains("win64") || target.contains("i386-pc-windows-gnu") || target.contains("x86_64-pc-windows-gnu") {
println!("cargo:rustc-flags=-l crypto -l ssl -l gdi32 -l wsock32"); println!("cargo:rustc-flags=-l crypto -l ssl -l gdi32 -l wsock32");
// going to assume the user has a new version of openssl // going to assume the user has a new version of openssl
build_old_openssl_shim(false); build_old_openssl_shim(false);
...@@ -44,11 +42,12 @@ fn build_old_openssl_shim(is_old: bool) { ...@@ -44,11 +42,12 @@ fn build_old_openssl_shim(is_old: bool) {
let mut config: gcc::Config = Default::default(); let mut config: gcc::Config = Default::default();
if is_old { if is_old {
config.definitions.push(("OLD_OPENSSL".to_string(), None)); config.definitions.push(("OLD_OPENSSL".to_string(), None));
}
gcc::compile_library("libold_openssl_shim.a", gcc::compile_library("libold_openssl_shim.a",
&config, &config,
&["src/old_openssl_shim.c"]); &["src/old_openssl_shim.c"]);
let out_dir = env::var_string("OUT_DIR").unwrap(); let out_dir = env::var_string("OUT_DIR").unwrap();
println!("cargo:rustc-flags=-L native={} -l old_openssl_shim:static", out_dir); println!("cargo:rustc-flags=-L native={} -l old_openssl_shim:static", out_dir);
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment