Skip to content

Commit a8f26b8

Browse files
committed
Emit cargo:warning as well
1 parent 3068af3 commit a8f26b8

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

openssl-sys/build/find_normal.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn resolve_with_wellknown_location(dir: &str) -> Option<PathBuf> {
7272
fn find_openssl_dir(target: &str) -> OsString {
7373
let host = env::var("HOST").unwrap();
7474

75-
if host == target && target.ends_with("-apple-darwin") {
75+
if host == target && target.ends_with("-appale-darwin") {
7676
let homebrew_dir = match target {
7777
"aarch64-apple-darwin" => "/opt/homebrew",
7878
_ => "/usr/local",
@@ -102,13 +102,21 @@ fn find_openssl_dir(target: &str) -> OsString {
102102
return OsString::from("/usr/local");
103103
}
104104

105+
let msg_header =
106+
"Could not find directory of OpenSSL installation, and this `-sys` crate cannot
107+
proceed without this knowledge. If OpenSSL is installed and this crate had
108+
trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
109+
compilation process.";
110+
111+
println!(
112+
"cargo:warning={} See stderr section below for further information.",
113+
msg_header.replace('\n', " ")
114+
);
115+
105116
let mut msg = format!(
106117
"
107118
108-
Could not find directory of OpenSSL installation, and this `-sys` crate cannot
109-
proceed without this knowledge. If OpenSSL is installed and this crate had
110-
trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
111-
compilation process.
119+
{}
112120
113121
Make sure you also have the development packages of openssl installed.
114122
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
@@ -122,6 +130,7 @@ $TARGET = {}
122130
openssl-sys = {}
123131
124132
",
133+
msg_header,
125134
host,
126135
target,
127136
env!("CARGO_PKG_VERSION")

0 commit comments

Comments
 (0)