diff options
| author | 2025-01-18 20:27:44 +0100 | |
|---|---|---|
| committer | 2025-01-18 20:27:44 +0100 | |
| commit | 4aa6c24ca7fdf192a01ea9383644b05c37bf2936 (patch) | |
| tree | c51721d433886abb31c38751ace976ce8d787acf /project.janet | |
| parent | prepare 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.janet | 8 |
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 |
