diff options
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 998c40208..b877b8cb7 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -225,6 +225,7 @@ struct BuildContext { String ODIN_VENDOR; // compiler vendor String ODIN_VERSION; // compiler version String ODIN_ROOT; // Odin ROOT + String ODIN_BUILD_PROJECT_NAME; // Odin main/initial package's directory name bool ODIN_DEBUG; // Odin in debug mode bool ODIN_DISABLE_ASSERT; // Whether the default 'assert' et al is disabled in code or not bool ODIN_DEFAULT_TO_NIL_ALLOCATOR; // Whether the default allocator is a "nil" allocator or not (i.e. it does nothing) @@ -1537,6 +1538,12 @@ bool init_build_paths(String init_filename) { enable_target_feature({}, bc->target_features_string); } + { + String build_project_name = last_path_element(bc->build_paths[BuildPath_Main_Package].basename); + GB_ASSERT(build_project_name.len > 0); + bc->ODIN_BUILD_PROJECT_NAME = build_project_name; + } + return true; } |