aboutsummaryrefslogtreecommitdiff
path: root/cbs.h
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2024-02-14 12:36:42 +0100
committerThomas Voss <thomas.voss@humanwave.nl> 2024-02-14 12:36:42 +0100
commitee3eb5ac6c89d10b4a564dedae50216b196bad9c (patch)
tree8c14f7018da5b64cefec6ba7844168fab838f819 /cbs.h
parent269d6af510b641c4d848ada8e20325205aa2e7be (diff)
Fix builds on MacOS
Diffstat (limited to 'cbs.h')
-rw-r--r--cbs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/cbs.h b/cbs.h
index 3fc854d..c13baa5 100644
--- a/cbs.h
+++ b/cbs.h
@@ -717,6 +717,7 @@ _rebuild(char *src)
{
char *bbn, *sbn, *argv0;
cmd_t cmd = {0};
+ struct strv sv = {0};
/* We assume that the compiled binary and the source file are in the same
directory. */
@@ -732,7 +733,9 @@ _rebuild(char *src)
if (!foutdated(bbn, sbn))
return;
- cmdadd(&cmd, "cc", "-std=c2x");
+ env_or_default(&sv, "CC", "cc");
+ cmdaddv(&cmd, sv.buf, sv.len);
+ cmdadd(&cmd, "-std=c2x");
#ifdef CBS_PTHREAD
cmdadd(&cmd, "-lpthread");
#endif