From 4aa6c24ca7fdf192a01ea9383644b05c37bf2936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Sat, 18 Jan 2025 20:27:44 +0100 Subject: fix executable detection This would cause pkg-config detection to fail. I should really write a libpkgconf integration at some point, huh? --- project.janet | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/project.janet b/project.janet index f0c7f83..92a73b7 100644 --- a/project.janet +++ b/project.janet @@ -30,8 +30,12 @@ (zero? (os/execute ["cc" "-xc" "-" "-o/dev/null" ;flags] :p {:err err :in inr :out out})))) -(def pkgconf (let [bin? |(if ((execute $) :status) $ false) - bin (or (bin? "pkgconf") (bin? "pkg-config"))] +(defn bin? + [x] + (case ((execute x) :status) + 0 x + 1 x)) +(def pkgconf (let [bin (or (bin? "pkgconf") (bin? "pkg-config"))] (fn pkgconf [defval & args] (if bin -- cgit v1.2.3