summary refs log tree commit diff
path: root/tpm2-sys
diff options
context:
space:
mode:
Diffstat (limited to 'tpm2-sys')
-rw-r--r--tpm2-sys/Cargo.toml2
-rw-r--r--tpm2-sys/build.rs11
2 files changed, 7 insertions, 6 deletions
diff --git a/tpm2-sys/Cargo.toml b/tpm2-sys/Cargo.toml
index 0297bf0..12dc5ac 100644
--- a/tpm2-sys/Cargo.toml
+++ b/tpm2-sys/Cargo.toml
@@ -8,5 +8,3 @@ links = "tpm2"
 [build-dependencies]
 num_cpus = "*"
 pkg-config = "*"
-
-[workspace]
diff --git a/tpm2-sys/build.rs b/tpm2-sys/build.rs
index f1abd4a..604d936 100644
--- a/tpm2-sys/build.rs
+++ b/tpm2-sys/build.rs
@@ -8,10 +8,11 @@ use std::path::Path;
 use std::process::{self, Command};
 
 fn main() -> io::Result<()> {
-    println!("cargo:rustc-link-lib=ssl");
-    println!("cargo:rustc-link-lib=crypto");
-
-    if pkg_config::probe_library("libtpm2").is_ok() {
+    if pkg_config::Config::new()
+        .statik(true)
+        .probe("libtpm2")
+        .is_ok()
+    {
         // Use tpm2 package from the standard system location if available.
         return Ok(());
     }
@@ -44,5 +45,7 @@ fn main() -> io::Result<()> {
     let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
     println!("cargo:rustc-link-search={}/libtpm2/build", dir);
     println!("cargo:rustc-link-lib=static=tpm2");
+    println!("cargo:rustc-link-lib=ssl");
+    println!("cargo:rustc-link-lib=crypto");
     Ok(())
 }