diff --git a/project/codegen/handmade_platform_gen.cpp b/project/codegen/engine_postbuild_gen.cpp similarity index 92% rename from project/codegen/handmade_platform_gen.cpp rename to project/codegen/engine_postbuild_gen.cpp index d14d659..fbd023b 100644 --- a/project/codegen/handmade_platform_gen.cpp +++ b/project/codegen/engine_postbuild_gen.cpp @@ -6,7 +6,7 @@ #include "dependencies/gen.hpp" using namespace gen; -#include "platform/platform_engine_api.hpp" +#include "engine/engine_to_platform_api.hpp" constexpr StrC fname_handmade_engine_symbols = txt("handmade_engine.symbols"); String get_symbol_from_module_table( FileContents symbol_table, u32 symbol_ID ) @@ -53,7 +53,7 @@ String get_symbol_from_module_table( FileContents symbol_table, u32 symbol_ID ) int gen_main() { gen::init(); - log_fmt("Generating code for Handmade Hero: Platfom Module\n"); + log_fmt("Generating code for Handmade Hero: Engine Module\n"); FileContents symbol_table = file_read_contents( GlobalAllocator, true, fname_handmade_engine_symbols ); @@ -61,7 +61,7 @@ int gen_main() #undef str_ascii Builder builder = Builder::open( "engine_symbol_table.hpp" ); builder.print( pragma_once ); - builder.print( def_include( txt("platform/platform.hpp") ) ); + builder.print( def_include( txt("engine/engine.hpp") ) ); builder.print( fmt_newline ); builder.print_fmt( "NS_ENGINE_BEGIN\n\n" ); @@ -93,9 +93,8 @@ int gen_main() builder.write(); #pragma pop_macro("str_ascii") - log_fmt("Generaton finished for Handmade Hero: Platform Module\n"); + log_fmt("Generaton finished for Handmade Hero: Engine Module\n"); // gen::deinit(); return 0; } #endif - diff --git a/project/codegen/handmade_engine_gen.cpp b/project/codegen/platform_gen.cpp similarity index 58% rename from project/codegen/handmade_engine_gen.cpp rename to project/codegen/platform_gen.cpp index e7db5df..22469db 100644 --- a/project/codegen/handmade_engine_gen.cpp +++ b/project/codegen/platform_gen.cpp @@ -3,19 +3,15 @@ #define GEN_IMPLEMENTATION #define GEN_BENCHMARK #define GEN_ENFORCE_STRONG_CODE_TYPES -#include "gen.hpp" +#include "dependencies/gen.hpp" using namespace gen; int gen_main() { gen::init(); - log_fmt("Generating code for Handmade Hero: Engine Module\n"); - - - - log_fmt("Generaton finished for Handmade Hero: Engine Module\n"); + log_fmt("Generating code for Handmade Hero: Platform Module\n"); + log_fmt("Generaton finished for Handmade Hero: Platform Module\n"); // gen::deinit(); return 0; } #endif - diff --git a/project/engine/engine.cpp b/project/engine/engine.cpp index c44f265..06b61f0 100644 --- a/project/engine/engine.cpp +++ b/project/engine/engine.cpp @@ -1,6 +1,6 @@ //#include "win32.h" #include "engine.hpp" -#include "platform/platform_engine_api.hpp" +#include "engine_to_platform_api.hpp" #include "handmade.hpp" NS_ENGINE_BEGIN diff --git a/project/platform/platform_engine_api.hpp b/project/engine/engine_to_platform_api.hpp similarity index 100% rename from project/platform/platform_engine_api.hpp rename to project/engine/engine_to_platform_api.hpp diff --git a/project/gen/engine_symbol_table.hpp b/project/gen/engine_symbol_table.hpp index d4605d7..4befc91 100644 --- a/project/gen/engine_symbol_table.hpp +++ b/project/gen/engine_symbol_table.hpp @@ -1,5 +1,5 @@ #pragma once -#include "platform/platform.hpp" +#include "engine/engine.hpp" NS_ENGINE_BEGIN diff --git a/project/platform/win32_platform.cpp b/project/platform/win32_platform.cpp index 7246fe2..de6460e 100644 --- a/project/platform/win32_platform.cpp +++ b/project/platform/win32_platform.cpp @@ -24,7 +24,7 @@ // Engine layer headers #include "engine/engine.hpp" -#include "platform_engine_api.hpp" +#include "engine/engine_to_platform_api.hpp" #include "gen/engine_symbol_table.hpp" diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 03c65d7..d192a69 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -404,6 +404,8 @@ $path_engine = Join-Path $path_project 'engine' $update_deps = Join-Path $PSScriptRoot 'update_deps.ps1' +$handmade_process_active = Get-Process | Where-Object {$_.Name -like 'handmade_win32*'} + if ( (Test-Path $path_build) -eq $false ) { New-Item $path_build -ItemType Directory } @@ -554,13 +556,9 @@ if ( $engine ) } Remove-Item $path_pdb_lock -Force -Verbose -} - -if ( $platform ) -{ #region CodeGen - if ( $true ) { + if ( $handmade_process_active -eq $null ) { $engine_codegen_compiler_args = @() $engine_codegen_compiler_args += ( $flag_define + 'GEN_TIME' ) @@ -568,8 +566,8 @@ if ( $platform ) $flag_link_win_subsystem_console ) - $unit = Join-Path $path_codegen 'handmade_platform_gen.cpp' - $executable = Join-Path $path_build 'handmade_platform_gen.exe' + $unit = Join-Path $path_codegen 'engine_postbuild_gen.cpp' + $executable = Join-Path $path_build 'engine_postbuild_gen.exe' build-simple $includes $engine_codegen_compiler_args $engine_codegen_linker_args $unit $executable write-host @@ -577,14 +575,16 @@ if ( $platform ) Push-Location $path_build & $executable Pop-Location - write-host $path_generated_file = Join-Path $path_build 'engine_symbol_table.hpp' move-item $path_generated_file (join-path $path_gen (split-path $path_generated_file -leaf)) -Force } #endregion CodeGen +} - # Delete old PDBs +if ( $platform ) +{ + # Delete old PDBs $pdb_files = Get-ChildItem -Path $path_binaries -Filter "handmade_win32_*.pdb" foreach ($file in $pdb_files) { Remove-Item -Path $file.FullName -Force