diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 6a9ea96..c1a7ba8 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -51,16 +51,20 @@ $flag_build_mode_dll = '-build-mode:dll' $flag_collection = '-collection:' $flag_debug = '-debug' $flag_define = '-define:' +$flag_default_allocator_nil = '-default-to-nil-allocator' $flag_disable_assert = '-disable-assert' +$flag_dynamic_map_calls = '-dynamic-map-calls' $flag_extra_assembler_flags = '-extra_assembler-flags:' $flag_extra_linker_flags = '-extra-linker-flags:' $flag_ignore_unknown_attributes = '-ignore-unknown-attributes' $flag_keep_temp_files = '-keep-temp-files' +$flag_max_error_count = '-max-error-count:' +$flag_micro_architecture_native = '-microarch:native' $flag_no_bounds_check = '-no-bounds-check' $flag_no_crt = '-no-crt' $flag_no_entrypoint = '-no-entry-point' $flag_no_thread_local = '-no-thread-local' -$flag_no_thread_checker = '-no-thread-checker' +$flag_no_thread_checker = '-no-threaded-checker' $flag_output_path = '-out=' $flag_optimization_level = '-opt:' $flag_optimize_none = '-o:none' @@ -69,7 +73,9 @@ $flag_optimize_size = '-o:size' $flag_optimize_speed = '-o:speed' $falg_optimize_aggressive = '-o:aggressive' $flag_pdb_name = '-pdb-name:' -$flag_sanitize = '-sanitize:' +$flag_sanitize_address = '-sanitize:address' +$flag_sanitize_memory = '-sanitize:memory' +$flag_sanitize_thread = '-sanitize:thread' $flag_subsystem = '-subsystem:' $flag_show_timings = '-show-timings' $flag_show_more_timings = '-show-more-timings' @@ -154,18 +160,25 @@ push-location $path_root $build_args += $flag_build_mode_dll $build_args += $flag_output_path + $module_dll # $build_args += ($flag_collection + $pkg_collection_thirdparty) + $build_args += $flag_micro_architecture_native $build_args += $flag_use_separate_modules $build_args += $flag_thread_count + $CoreCount_Physical - # $build_args += $flag_optimize_none + $build_args += $flag_optimize_none # $build_args += $flag_optimize_minimal # $build_args += $flag_optimize_speed - $build_args += $falg_optimize_aggressive + # $build_args += $falg_optimize_aggressive $build_args += $flag_debug $build_args += $flag_pdb_name + $pdb $build_args += $flag_subsystem + 'windows' # $build_args += $flag_show_system_calls $build_args += $flag_show_timings # $build_args += ($flag_extra_linker_flags + $linker_args ) + # $build_args += $flag_no_thread_checker + # $build_args += $flag_dynamic_map_calls + $build_args += $flag_default_allocator_nil + $build_args += ($flag_max_error_count + '10') + # $build_args += $flag_sanitize_address + # $build_args += $flag_sanitize_memory $raddbg_args = @() $raddbg_args += $odin_compiler @@ -225,18 +238,25 @@ push-location $path_root $build_args += './host' $build_args += $flag_output_path + $executable # $build_args += ($flag_collection + $pkg_collection_thirdparty) + # $build_args += $flag_micro_architecture_native $build_args += $flag_use_separate_modules $build_args += $flag_thread_count + $CoreCount_Physical - # $build_args += $flag_optimize_none + $build_args += $flag_optimize_none # $build_args += $flag_optimize_minimal # $build_args += $flag_optimize_speed - $build_args += $falg_optimize_aggressive + # $build_args += $falg_optimize_aggressive $build_args += $flag_debug $build_args += $flag_pdb_name + $pdb $build_args += $flag_subsystem + 'windows' # $build_args += ($flag_extra_linker_flags + $linker_args ) $build_args += $flag_show_timings # $build_args += $flag_show_system_call + # $build_args += $flag_no_bounds_check + # $build_args += $flag_no_thread_checker + # $build_args += $flag_default_allocator_nil + $build_args += ($flag_max_error_count + '10') + # $build_args += $flag_sanitize_address + # $build_args += $flag_sanitize_memory Invoke-WithColorCodedOutput { & $odin_compiler $build_args } } diff --git a/scripts/setup_shell.ps1 b/scripts/setup_shell.ps1 index 918c91f..630b98f 100644 --- a/scripts/setup_shell.ps1 +++ b/scripts/setup_shell.ps1 @@ -1,3 +1,8 @@ set-alias -Name 'build' -Value '.\build.ps1' set-alias -Name 'buildclean' -Value '.\clean.ps1' +$path_root = git rev-parse --show-toplevel +$path_thirdparty = join-path $path_root 'thirdparty' +$path_odin = join-path $path_thirdparty 'Odin' + +$env:odin = $path_odin diff --git a/scripts/update_deps.ps1 b/scripts/update_deps.ps1 index be358ef..ac28dd1 100644 --- a/scripts/update_deps.ps1 +++ b/scripts/update_deps.ps1 @@ -9,6 +9,7 @@ $url_odin_repo = 'https://github.com/Ed94/Odin.git' $url_ini_parser = 'https://github.com/laytan/odin-ini-parser.git' $path_odin = join-path $path_thirdparty 'Odin' $path_ini_parser = join-path $path_thirdparty 'ini' +$path_ols = join-path $path_thirdparty 'ols' $incremental_checks = Join-Path $PSScriptRoot 'helpers/incremental_checks.ps1' . $incremental_checks @@ -19,11 +20,25 @@ if ( -not(Test-Path $path_thirdparty) ) { push-location $path_thirdparty +if ((Test-Path -Path $path_ols) -and $false) +{ + Write-Host "Updating ols" + push-location $path_ols + $env:odin = join-path $path_odin 'odin.exe' + + & .\build.bat + remove-item env:odin + pop-location + + write-host +} + if (Test-Path -Path $path_odin) { Write-Host "Checking for updates in the Odin repository..." git -C $path_odin fetch + # TODO(Ed) : This is no longer a valid way to detect changes since I update a personal repo myself (within this local instance) # Get the latest local and remote commit hashes for the current branch $localCommit = git -C $path_odin rev-parse HEAD $remoteCommit = git -C $path_odin rev-parse '@{u}'