mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-04 04:02:33 +00:00
Add ODIN_DEBUG
This commit is contained in:
@@ -7,6 +7,7 @@ struct BuildContext {
|
||||
String ODIN_VENDOR; // compiler vendor
|
||||
String ODIN_VERSION; // compiler version
|
||||
String ODIN_ROOT; // Odin ROOT
|
||||
bool ODIN_DEBUG; // Odin in debug mode
|
||||
|
||||
// In bytes
|
||||
i64 word_size; // Size of a pointer, must be >= 4
|
||||
@@ -22,7 +23,6 @@ struct BuildContext {
|
||||
i32 optimization_level;
|
||||
bool show_timings;
|
||||
bool keep_temp_files;
|
||||
bool debug;
|
||||
bool no_bounds_check;
|
||||
|
||||
gbAffinity affinity;
|
||||
|
||||
@@ -548,6 +548,7 @@ void init_universal_scope(void) {
|
||||
add_global_string_constant(a, str_lit("ODIN_VENDOR"), bc->ODIN_VENDOR);
|
||||
add_global_string_constant(a, str_lit("ODIN_VERSION"), bc->ODIN_VERSION);
|
||||
add_global_string_constant(a, str_lit("ODIN_ROOT"), bc->ODIN_ROOT);
|
||||
add_global_constant(a, str_lit("ODIN_DEBUG"), t_untyped_bool, exact_value_bool(bc->ODIN_DEBUG));
|
||||
|
||||
|
||||
// Builtin Procedures
|
||||
|
||||
@@ -7598,7 +7598,7 @@ void ir_init_module(irModule *m, Checker *c) {
|
||||
m->info = &c->info;
|
||||
|
||||
m->generate_debug_info = false;
|
||||
if (build_context.debug) {
|
||||
if (build_context.ODIN_DEBUG) {
|
||||
m->generate_debug_info = build_context.ODIN_OS == "windows" && build_context.word_size == 8;
|
||||
}
|
||||
|
||||
|
||||
@@ -505,7 +505,7 @@ bool parse_build_flags(Array<String> args) {
|
||||
}
|
||||
|
||||
case BuildFlag_Debug:
|
||||
build_context.debug = true;
|
||||
build_context.ODIN_DEBUG = true;
|
||||
break;
|
||||
|
||||
case BuildFlag_NoBoundsCheck:
|
||||
|
||||
Reference in New Issue
Block a user