From b1bc7e9d697c092898596fe9cad691110aaf2bc7 Mon Sep 17 00:00:00 2001 From: Marko Budiselic Date: Sat, 17 Aug 2024 21:34:04 +0200 Subject: [PATCH] Add option to statically link OpenSSL --- build.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 32167fd..9e2efc4 100644 --- a/build.rs +++ b/build.rs @@ -195,12 +195,15 @@ fn main() { mgclient_out.join(lib_dir).display() ); println!("cargo:rustc-link-lib=static=mgclient"); - // If the following part of the code is pushed inside build_mgclient_xzy, linking is not done - // properly. + // If the following part of the code is pushed inside + // build_mgclient_xzy, linking is not done properly. match host_type { HostType::Linux => { - println!("cargo:rustc-link-lib=dylib=crypto"); - println!("cargo:rustc-link-lib=dylib=ssl"); + println!("cargo:rustc-link-search=/usr/lib/x86_64-linux-gnu"); + println!("cargo:rustc-link-lib=static=crypto"); + println!("cargo:rustc-link-lib=static=ssl"); + // println!("cargo:rustc-link-lib=dylib=crypto"); + // println!("cargo:rustc-link-lib=dylib=ssl"); } HostType::Windows => { println!("cargo:rustc-link-lib=dylib=libcrypto");