You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
622 B

  1. use std::env;
  2. macro_rules! set_rustc_env_var {
  3. ($name: expr, $value: expr) => {{
  4. println!("cargo:rustc-env={}={}", $name, $value);
  5. }};
  6. }
  7. #[allow(clippy::unusual_byte_groupings)]
  8. fn main() {
  9. if let Ok(v) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
  10. let version = u64::from_str_radix(&v, 16).unwrap();
  11. // OpenSSL 1.1.1
  12. if version >= 0x1_01_01_00_0 {
  13. println!("cargo:rustc-cfg=ed25519");
  14. println!("cargo:rustc-cfg=ed448");
  15. }
  16. set_rustc_env_var!("ACMED_TLS_LIB_NAME", "OpenSSL");
  17. }
  18. if env::var("DEP_OPENSSL_LIBRESSL_VERSION_NUMBER").is_ok() {
  19. set_rustc_env_var!("ACMED_TLS_LIB_NAME", "LibreSSL");
  20. }
  21. }