summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-08 17:22:29 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-08 17:22:29 -0400
commitee3fff389fbe2e2ba7776e4e24d91d95e01672ba (patch)
treed095aa9707fa95160f3afe14de2a90db9313e982 /main.c
parenta4a3e4a69499bf967d593572f4cddd3956b393c2 (diff)
debug and release builds; reading files still not fully tested
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.c b/main.c
index 1fb6f34..1863a1c 100644
--- a/main.c
+++ b/main.c
@@ -124,6 +124,7 @@ int main(int argc, char **argv) {
const char *out_filename = "out.c";
bool verbose = false;
+ bool debug_build = true;
ErrCtx err_ctx = {0};
err_ctx.enabled = true;
@@ -156,6 +157,10 @@ int main(int argc, char **argv) {
} else if (streq(arg, "-v") || streq(arg, "-verbose")) {
printf("Verbose mode enabled\n");
verbose = true;
+ } else if (streq(arg, "-d") || streq(arg, "-debug")) {
+ debug_build = true;
+ } else if (streq(arg, "-r") || streq(arg, "-release")) {
+ debug_build = false;
} else {
if (arg[0] == '-') {
fprintf(stderr, "Unrecognized option: %s.\n", argv[i]);
@@ -215,6 +220,7 @@ int main(int argc, char **argv) {
str_hash_table_create(&global_ctx.included_files, sizeof(IncludedFile), &main_allocr);
global_ctx.main_file = &file;
global_ctx.err_ctx = &err_ctx;
+ global_ctx.debug_build = debug_build;
Parser p;
parser_create(&p, &globals, &t, &main_allocr, &global_ctx);