From b92bed025fcca8be56c00825ba4232165c21f711 Mon Sep 17 00:00:00 2001 From: Des-Nerger Date: Mon, 26 Aug 2024 12:59:06 +1000 Subject: [PATCH] Add pkg-config as fallback for MagickCore-config Fixes nlfiedler/magick-rust#131 --- build.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 4813866..eb0f632 100644 --- a/build.rs +++ b/build.rs @@ -123,7 +123,14 @@ fn main() { .arg("--cppflags") .output() } else { - Command::new("MagickCore-config").arg("--cppflags").output() + Command::new("MagickCore-config") + .arg("--cppflags") + .output() + .or_else(|_| { + Command::new("pkg-config") + .args(["--cflags", "MagickCore"]) + .output() + }) }; if let Ok(ok_cppflags) = check_cppflags { let cppflags = ok_cppflags.stdout;