aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-01-29 16:18:38 +0000
committerGitHub <noreply@github.com>2024-01-29 16:18:38 +0000
commitf588593ff15fa13e89bd869a52b2ff9bf9d91341 (patch)
tree8f2c0a32259c405c53396ead12b1c8f3f5c261d0 /src/main.cpp
parenta78f062499c7f0112558872a500904e6fbc6761b (diff)
parenta626adac8e8e0ca0506401cf3376727ad801091c (diff)
Merge pull request #3147 from odin-lang/base-work
`base` library collection work
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 19271d667..d77f135a1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -273,6 +273,7 @@ enum BuildFlagKind {
BuildFlag_DisallowDo,
BuildFlag_DefaultToNilAllocator,
+ BuildFlag_DefaultToPanicAllocator,
BuildFlag_StrictStyle,
BuildFlag_ForeignErrorProcedures,
BuildFlag_NoRTTI,
@@ -460,6 +461,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
add_flag(&build_flags, BuildFlag_DisallowDo, str_lit("disallow-do"), BuildFlagParam_None, Command__does_check);
add_flag(&build_flags, BuildFlag_DefaultToNilAllocator, str_lit("default-to-nil-allocator"), BuildFlagParam_None, Command__does_check);
+ add_flag(&build_flags, BuildFlag_DefaultToPanicAllocator, str_lit("default-to-panic-allocator"),BuildFlagParam_None, Command__does_check);
add_flag(&build_flags, BuildFlag_StrictStyle, str_lit("strict-style"), BuildFlagParam_None, Command__does_check);
add_flag(&build_flags, BuildFlag_ForeignErrorProcedures, str_lit("foreign-error-procedures"), BuildFlagParam_None, Command__does_check);
@@ -1122,8 +1124,20 @@ gb_internal bool parse_build_flags(Array<String> args) {
break;
case BuildFlag_DefaultToNilAllocator:
+ if (build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
+ gb_printf_err("'-default-to-panic-allocator' cannot be used with '-default-to-nil-allocator'\n");
+ bad_flags = true;
+ }
build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR = true;
break;
+ case BuildFlag_DefaultToPanicAllocator:
+ if (build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR) {
+ gb_printf_err("'-default-to-nil-allocator' cannot be used with '-default-to-panic-allocator'\n");
+ bad_flags = true;
+ }
+ build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR = true;
+ break;
+
case BuildFlag_ForeignErrorProcedures:
build_context.ODIN_FOREIGN_ERROR_PROCEDURES = true;
break;
@@ -2376,6 +2390,7 @@ int main(int arg_count, char const **arg_ptr) {
TIME_SECTION("init default library collections");
array_init(&library_collections, heap_allocator());
// NOTE(bill): 'core' cannot be (re)defined by the user
+ add_library_collection(str_lit("base"), get_fullpath_relative(heap_allocator(), odin_root_dir(), str_lit("base")));
add_library_collection(str_lit("core"), get_fullpath_relative(heap_allocator(), odin_root_dir(), str_lit("core")));
add_library_collection(str_lit("vendor"), get_fullpath_relative(heap_allocator(), odin_root_dir(), str_lit("vendor")));