Add optimization flag

This commit is contained in:
Bruce Hill 2024-03-24 16:19:59 -04:00
parent bdfb388aa1
commit 118517fb02

6
tomo.c
View File

@ -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);