aboutsummaryrefslogtreecommitdiff
path: root/cbs.h
diff options
context:
space:
mode:
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