diff --git a/Cargo.toml b/Cargo.toml index 8d48bfb5..7d22e8fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ version = "0.3.0" authors = ["Jacob Hoffman-Andrews "] description = "C-to-rustls bindings" edition = "2018" +links = "crustls" [dependencies] # Keep in sync with RUSTLS_CRATE_VERSION in lib.rs @@ -19,4 +20,4 @@ cbindgen = "*" [lib] name = "crustls" -crate-type = ["staticlib"] +crate-type = ["lib", "staticlib"] diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..6ef3c876 --- /dev/null +++ b/build.rs @@ -0,0 +1,11 @@ +use std::{env, fs, path::PathBuf}; + +fn main() { + let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); + let include_dir = out_dir.join("include"); + + fs::create_dir_all(&include_dir).unwrap(); + fs::copy("src/crustls.h", include_dir.join("crustls.h")).unwrap(); + + println!("cargo:include={}", include_dir.to_str().unwrap()); +}