diff --git a/.vscode/launch.json b/.vscode/launch.json index b9f0b72..ae30b68 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "name": "Debug gentime lldb", "program": "${workspaceFolder}/test/test.exe", "args": [], - "cwd": "${workspaceFolder}/test/gen/", + "cwd": "${workspaceFolder}/test/", "postRunCommands": [ ] }, @@ -20,7 +20,7 @@ "name": "Debug gentime vsdbg", "program": "${workspaceFolder}/test/build/test.exe", "args": [], - "cwd": "${workspaceFolder}/test/gen/", + "cwd": "${workspaceFolder}/test/", "visualizerFile": "${workspaceFolder}/scripts/gencpp.natvis" }, { diff --git a/project/dependencies/strings.hpp b/project/dependencies/strings.hpp index 18b145c..16a8ffc 100644 --- a/project/dependencies/strings.hpp +++ b/project/dependencies/strings.hpp @@ -72,7 +72,7 @@ struct String header->Capacity = capacity; header->Length = 0; - String result = { (char*)allocation + header_size }; + String result = { rcast(char*, allocation) + header_size }; return result; } diff --git a/scripts/build.ci.ps1 b/scripts/build.ci.ps1 index 993d6b3..37ec35f 100644 --- a/scripts/build.ci.ps1 +++ b/scripts/build.ci.ps1 @@ -298,7 +298,6 @@ if ( $vendor -match "msvc" ) #endregion Configuration #region Building - $path_build = Join-Path $path_root build $path_project = Join-Path $path_root project $path_scripts = Join-Path $path_root scripts @@ -348,14 +347,14 @@ if ( $singleheader ) New-Item -ItemType Directory -Path $path_gen } - $includes = @($path_project) + $includes = @( $path_project ) $unit = join-path $path_singleheader "singleheader.cpp" $executable = join-path $path_build "singleheader.exe" build-simple $includes $unit $executable Push-Location $path_singleheader - if ( Test-Path($executable) ) { + if ( Test-Path( $executable ) ) { write-host "`nRunning singleheader generator" $time_taken = Measure-Command { & $executable | ForEach-Object { @@ -385,13 +384,11 @@ if ( $test ) $path_bootstrap = join-path $path_project gen - $include = $path_bootstrap + $includes = @( $path_bootstrap ) $unit = join-path $path_test "test.cpp" - $object = join-path $path_build "test.obj" $executable = join-path $path_build "test.exe" - $pdb = join-path $path_build "test.pdb" - build-simple $include $unit $executable + build-simple $includes $unit $executable Push-Location $path_test if ( Test-Path( $executable ) ) { @@ -408,7 +405,6 @@ if ( $test ) #endregion Building #region Formatting - function format-cpp { param( $path, $include, $exclude ) @@ -457,7 +453,12 @@ if ( $singleheader -and (Test-Path (Join-Path $path_singleheader "gen/gen.hpp")) if ( $test ) { - + $path_gen = join-path $path_test gen + $include = @( + '*.gen.hpp' + ) + $exclude = $null + format-cpp $path_gen $include $exclude } #endregion Formatting diff --git a/test/sanity.cpp b/test/sanity.cpp index 992907c..dc63eac 100644 --- a/test/sanity.cpp +++ b/test/sanity.cpp @@ -63,8 +63,7 @@ void check_sanity() log_fmt("Num String Cache Arenas : %llu TotalSize: %llu !\n", StringArenas.num(), StringArenas.num() * SizePer_StringArena); log_fmt("Num String Cache : %llu\n", StringCache.Entries.num(), StringCache); - Builder builder; - builder.open( "gen/sanity.gen.hpp" ); + Builder builder = Builder::open( "./gen/sanity.gen.hpp" ); idx = typedefs.num(); #ifdef GEN_BENCHMARK diff --git a/test/test.cpp b/test/test.cpp index d8e7a7e..5362de4 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,3 +1,4 @@ +#if GEN_TIME #define GEN_DEFINE_LIBRARY_CODE_CONSTANTS #define GEN_ENFORCE_STRONG_CODE_TYPES #define GEN_EXPOSE_BACKEND @@ -8,13 +9,12 @@ #include "SOA.cpp" #include "test.singleheader_ast.cpp" -#if GEN_TIME int gen_main() { using namespace gen; log_fmt("\ngen_time:"); - check_sanity(); + // check_sanity(); // check_SOA(); diff --git a/test/test.singleheader_ast.cpp b/test/test.singleheader_ast.cpp index 707d2f6..e9d9388 100644 --- a/test/test.singleheader_ast.cpp +++ b/test/test.singleheader_ast.cpp @@ -9,7 +9,7 @@ using namespace gen; void check_singleheader_ast() { - #define project_dir "../../" + #define project_dir "../" gen::init(); log_fmt("\ncheck_singleheader_ast:\n"); diff --git a/vc140.pdb b/vc140.pdb new file mode 100644 index 0000000..851b585 Binary files /dev/null and b/vc140.pdb differ