From 1cce652cf4528c501d613d11102550f7057bb0f7 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 28 Sep 2025 02:09:16 -0400 Subject: [PATCH] Update build instructions for Visual Studio project generation and vcpkg integration - Changed the project file generation command from PowerShell to Python for better integration with vcpkg. - Enhanced documentation to clarify automatic vcpkg dependency management for zlib, libpng, and SDL2. - Added note that generated project files will remain in sync with CMake configuration. --- docs/02-build-instructions.md | 9 +++--- docs/vcpkg-integration.md | 59 ++++++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/docs/02-build-instructions.md b/docs/02-build-instructions.md index 9653a8e7..be8e9221 100644 --- a/docs/02-build-instructions.md +++ b/docs/02-build-instructions.md @@ -201,8 +201,8 @@ cmake -B build -DCMAKE_BUILD_TYPE=Release # All platforms # Setup development environment .\scripts\setup-windows-dev.ps1 -# Generate Visual Studio project files -.\scripts\generate-vs-projects.ps1 +# Generate Visual Studio project files (with proper vcpkg integration) +python scripts/generate-vs-projects.py # Open YAZE.sln in Visual Studio 2022 # Select configuration (Debug/Release) and platform (x64/x86/ARM64) @@ -212,9 +212,10 @@ cmake -B build -DCMAKE_BUILD_TYPE=Release # All platforms **Features:** - Full IntelliSense support - Integrated debugging -- vcpkg dependency management +- Automatic vcpkg dependency management (zlib, libpng, SDL2) - Multi-platform support (x64, x86, ARM64) - Automatic asset copying +- Generated project files stay in sync with CMake configuration ### VS Code 1. Install CMake Tools extension @@ -246,7 +247,7 @@ The project includes several PowerShell and Batch scripts to streamline Windows - Visual Studio 2022 detection ### Project Generation Scripts -- **`generate-vs-projects.ps1`**: Generate Visual Studio project files +- **`generate-vs-projects.py`**: Generate Visual Studio project files with proper vcpkg integration - **`generate-vs-projects.bat`**: Batch version of project generation **Features:** diff --git a/docs/vcpkg-integration.md b/docs/vcpkg-integration.md index 9014530e..e8257766 100644 --- a/docs/vcpkg-integration.md +++ b/docs/vcpkg-integration.md @@ -11,7 +11,8 @@ vcpkg is Microsoft's C++ package manager that simplifies dependency management f ## Features - **Manifest Mode**: Dependencies are automatically managed via `vcpkg.json` -- **Visual Studio Integration**: Seamless integration with Visual Studio 2019+ +- **Visual Studio Integration**: Seamless integration with Visual Studio 2022 +- **Generated Project Files**: Visual Studio project files with proper vcpkg integration - **CMake Presets**: Pre-configured build presets for Windows - **Automatic Setup**: Setup scripts for easy vcpkg installation @@ -20,15 +21,27 @@ vcpkg is Microsoft's C++ package manager that simplifies dependency management f ### 1. Setup vcpkg Run the automated setup script: -```cmd -# Command Prompt -scripts\setup-vcpkg-windows.bat - -# PowerShell -.\scripts\setup-vcpkg-windows.ps1 +```powershell +# PowerShell (recommended) +.\scripts\setup-windows-dev.ps1 ``` -### 2. Build with vcpkg +This will: +- Set up vcpkg +- Install dependencies (zlib, libpng, SDL2) +- Generate Visual Studio project files with proper vcpkg integration + +### 2. Build with Visual Studio + +```powershell +# Generate project files (if not already done) +python scripts/generate-vs-projects.py + +# Open YAZE.sln in Visual Studio 2022 +# Select configuration and platform, then build +``` + +### 3. Alternative: Build with CMake Use the Windows presets in CMakePresets.json: @@ -52,13 +65,23 @@ The `vcpkg.json` file defines all dependencies: { "name": "yaze", "version": "0.3.1", + "description": "Yet Another Zelda3 Editor", "dependencies": [ - "zlib", - "libpng", - "sdl2", - "abseil", - "gtest" - ] + { + "name": "zlib", + "platform": "!uwp" + }, + { + "name": "libpng", + "platform": "!uwp" + }, + { + "name": "sdl2", + "platform": "!uwp", + "features": ["vulkan"] + } + ], + "builtin-baseline": "2024.12.12" } ``` @@ -82,10 +105,10 @@ Available Windows presets: vcpkg automatically installs these dependencies: - **zlib**: Compression library -- **libpng**: PNG image support -- **sdl2**: Graphics and input handling -- **abseil**: Google's C++ common libraries -- **gtest**: Google Test framework (with gmock) +- **libpng**: PNG image support +- **sdl2**: Graphics and input handling (with Vulkan support) + +**Note**: Abseil and gtest are now built from source via CMake rather than through vcpkg to avoid compatibility issues. ## Environment Variables