diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-15 17:34:35 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-15 17:34:35 +0000 |
| commit | 6c4867081985a8dd1cccb3e5c503d72807e4ee87 (patch) | |
| tree | ad05274b4f59af1fd043917553894d7879141057 /core/runtime | |
| parent | 51dcbc80c3f0ef8755a0dc07b257ca93b264c2cc (diff) | |
Make `ODIN_BUILD_MODE` a enum type
Diffstat (limited to 'core/runtime')
| -rw-r--r-- | core/runtime/core.odin | 13 | ||||
| -rw-r--r-- | core/runtime/entry_unix.odin | 2 | ||||
| -rw-r--r-- | core/runtime/entry_windows.odin | 2 | ||||
| -rw-r--r-- | core/runtime/internal.odin | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin index be30eef02..91b6bf5ca 100644 --- a/core/runtime/core.odin +++ b/core/runtime/core.odin @@ -386,6 +386,19 @@ Raw_Cstring :: struct { } +/* + // Defined internally by the compiler + Odin_Build_Mode_Type :: enum int { + Executable, + Dynamic, + Object, + Assembly, + LLVM_IR, + } +*/ +Odin_Build_Mode_Type :: type_of(ODIN_BUILD_MODE) + + ///////////////////////////// // Init Startup Procedures // ///////////////////////////// diff --git a/core/runtime/entry_unix.odin b/core/runtime/entry_unix.odin index 38116c0f9..67d2cbcb7 100644 --- a/core/runtime/entry_unix.odin +++ b/core/runtime/entry_unix.odin @@ -4,7 +4,7 @@ package runtime import "core:intrinsics" -when ODIN_BUILD_MODE == "dynamic" { +when ODIN_BUILD_MODE == .Dynamic { @(link_name="_odin_entry_point", linkage="strong", require, link_section=".init") _odin_entry_point :: proc "c" () { context = default_context() diff --git a/core/runtime/entry_windows.odin b/core/runtime/entry_windows.odin index ef8b0c529..97a5bebe6 100644 --- a/core/runtime/entry_windows.odin +++ b/core/runtime/entry_windows.odin @@ -4,7 +4,7 @@ package runtime import "core:intrinsics" -when ODIN_BUILD_MODE == "dynamic" { +when ODIN_BUILD_MODE == .Dynamic { @(link_name="DllMain", linkage="strong", require) DllMain :: proc "stdcall" (hinstDLL: rawptr, fdwReason: u32, lpReserved: rawptr) -> b32 { context = default_context() diff --git a/core/runtime/internal.odin b/core/runtime/internal.odin index 6498c4db7..7b283a132 100644 --- a/core/runtime/internal.odin +++ b/core/runtime/internal.odin @@ -8,7 +8,7 @@ IS_WASM :: ODIN_ARCH == "wasm32" || ODIN_ARCH == "wasm64" @(private) RUNTIME_LINKAGE :: "strong" when ( (ODIN_USE_SEPARATE_MODULES || - ODIN_BUILD_MODE == "dynamic" || + ODIN_BUILD_MODE == .Dynamic || !ODIN_NO_CRT) && !IS_WASM) else "internal" RUNTIME_REQUIRE :: true |