Make ODIN_BUILD_MODE a enum type

This commit is contained in:
gingerBill
2022-01-15 17:34:35 +00:00
parent 51dcbc80c3
commit 6c48670819
7 changed files with 144 additions and 74 deletions
+13
View File
@@ -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 //
/////////////////////////////
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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