aboutsummaryrefslogtreecommitdiff
path: root/project.janet
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2025-01-18 20:27:44 +0100
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2025-01-18 20:27:44 +0100
commit4aa6c24ca7fdf192a01ea9383644b05c37bf2936 (patch)
treec51721d433886abb31c38751ace976ce8d787acf /project.janet
parentprepare 1.4.2 release (diff)
fix executable detection
This would cause pkg-config detection to fail. I should really write a libpkgconf integration at some point, huh?
Diffstat (limited to 'project.janet')
-rw-r--r--project.janet8
1 files 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