mirror of
https://github.com/Ed94/WATL_Exercise.git
synced 2025-08-04 22:32:43 -07:00
setup proper incremental build of build.odin.odin script
This commit is contained in:
@@ -27,6 +27,10 @@ indent_size = 2
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
[*.odin]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
[*.ps1]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
@@ -6,6 +6,11 @@ Toolchain: odin-lang/Odin dev-2025-06
|
||||
*/
|
||||
package odin
|
||||
|
||||
main :: proc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
import "base:builtin"
|
||||
import "base:intrinsics"
|
||||
|
||||
@@ -103,29 +108,42 @@ sll_stack_push_n :: proc(first: ^$SLL_NodeType, n: ^SLL_NodeType) {
|
||||
first^ = n
|
||||
}
|
||||
sll_queue_push_nz :: proc(nil_val: ^$SLL_NodeType, first: ^SLL_NodeType, last: ^SLL_NodeType, n: ^SLL_NodeType) {
|
||||
if first^ == nil_val {
|
||||
first^ = n
|
||||
last^ = n
|
||||
n.next = nil_val
|
||||
} else {
|
||||
last^.next = n
|
||||
last^ = n
|
||||
n.next = nil_val
|
||||
}
|
||||
if first^ == nil_val {
|
||||
first^ = n
|
||||
last^ = n
|
||||
n.next = nil_val
|
||||
} else {
|
||||
last^.next = n
|
||||
last^ = n
|
||||
n.next = nil_val
|
||||
}
|
||||
}
|
||||
sll_queue_push_n :: proc(first: ^$SLL_NodeType, last: ^SLL_NodeType, n: ^SLL_NodeType) {
|
||||
sll_queue_push_nz(nil, first, last, n)
|
||||
}
|
||||
//#endregion("Memory")
|
||||
|
||||
//#region Allocator Interface
|
||||
AllocatorOp :: enum u32 {
|
||||
Alloc_NoZero = 0, // If Alloc exist, so must No_Zero
|
||||
Alloc,
|
||||
Free,
|
||||
Reset,
|
||||
Grow_NoZero,
|
||||
Grow,
|
||||
Shrink,
|
||||
Rewind,
|
||||
SavePoint,
|
||||
Query, // Must always be implemented
|
||||
}
|
||||
AllocatorQueryFlag :: enum u64 {
|
||||
|
||||
}
|
||||
//#endregion Allocator Interface
|
||||
|
||||
//#region("Strings")
|
||||
Raw_String :: struct {
|
||||
data: [^]byte,
|
||||
len: int,
|
||||
}
|
||||
//#endregion("Strings")
|
||||
|
||||
main :: proc()
|
||||
{
|
||||
|
||||
}
|
||||
|
@@ -23,6 +23,13 @@ $flag_optimize_none = '-o:none'
|
||||
$flag_output_path = '-out='
|
||||
$flag_default_allocator_nil = '-default-to-nil-allocator'
|
||||
|
||||
$need_rebuild = $false
|
||||
if (-not (test-path $exe)) { $need_rebuild = $true }
|
||||
else {
|
||||
$source_hash = (get-filehash $path_source -algorithm MD5).Hash
|
||||
$exe_hash = (get-filehash $exe -algorithm MD5).Hash
|
||||
if ($exe_hash -ne $source_hash) { $need_rebuild = $true }
|
||||
}
|
||||
push-location $path_root
|
||||
$build_args = @()
|
||||
$build_args += $command_build
|
||||
@@ -36,6 +43,6 @@ $build_args += $flag_no_type_assert
|
||||
$build_args += $flag_dyn_map_calls
|
||||
$build_args += $flag_default_allocator_nil
|
||||
$build_args += $flag_output_path + $exe
|
||||
# & $odin $build_args
|
||||
& $exe
|
||||
if ($need_rebuild) { & $odin $build_args }
|
||||
pop-location
|
||||
& $exe
|
||||
|
Reference in New Issue
Block a user