Add custom build step for yaze_config.h generation in YAZE project

- Introduced a custom build step in `YAZE.vcxproj` to generate the `yaze_config.h` file, defining versioning macros for different build configurations (Debug and Release) across multiple platforms (Win32, x64, ARM64).
- This enhancement streamlines the build process by automating the creation of configuration headers, improving maintainability and version tracking.
This commit is contained in:
scawful
2025-09-28 18:36:11 -04:00
parent 7a887d96fd
commit 99eee4f6c8

View File

@@ -505,6 +505,31 @@
<None Include="zelda3.sfc" />
</ItemGroup>
<!-- Custom Build for yaze_config.h generation -->
<ItemGroup>
<CustomBuild Include="src\yaze_config.h.in">
<FileType>Document</FileType>
</CustomBuild>
</ItemGroup>
<!-- Custom Build Step for yaze_config.h -->
<ItemDefinitionGroup>
<CustomBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">echo #define YAZE_VERSION_MAJOR 0 > "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_MINOR 3 >> "$(ProjectDir)build-$(Platform)\yaze_config.h" &amp; echo #define YAZE_VERSION_PATCH 1 >> "$(ProjectDir)build-$(Platform)\yaze_config.h"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(ProjectDir)build-$(Platform)\yaze_config.h</Outputs>
</CustomBuild>
</ItemDefinitionGroup>
<ItemGroup>
<PackageReference Include="sdl2" Version="2.28.5" />
</ItemGroup>