aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tomo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tomo.c b/tomo.c
index 087a8d4c..78b5e4a4 100644
--- a/tomo.c
+++ b/tomo.c
@@ -65,9 +65,12 @@ int main(int argc, char *argv[])
if (!cconfig)
cconfig = "-std=c11 -fdollars-in-identifiers -fsanitize=signed-integer-overflow -fno-sanitize-recover -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE";
+ const char *optimization = getenv("O");
+ if (!optimization) optimization = "-O1";
+
cflags = getenv("CFLAGS");
if (!cflags)
- cflags = heap_strf("%s -I. -D_DEFAULT_SOURCE", cconfig);
+ cflags = heap_strf("%s %s -I. -D_DEFAULT_SOURCE", cconfig, optimization);
ldlibs = "-lgc -lcord -lm -L. -ltomo";
if (getenv("LDLIBS"))
@@ -227,7 +230,6 @@ int transpile(const char *filename, bool force_retranspile)
printf("Transpiled to %s.c\n", f->filename);
}
-
if (verbose) {
FILE *out = popen(heap_strf("bat -P %s.h %s.c", f->filename, f->filename), "w");
CORD_put(module.header, out);