backend-infra-engineer: Release v0.3.1 snapshot

This commit is contained in:
scawful
2025-09-28 03:07:45 -04:00
parent e32ac75b9c
commit 4371618a9b
88 changed files with 17940 additions and 4600 deletions

143
scripts/README.md Normal file
View File

@@ -0,0 +1,143 @@
# YAZE Build Scripts
This directory contains build and setup scripts for YAZE development on different platforms.
## Windows Scripts
### Setup Scripts
- **`setup-windows-dev.ps1`** - Complete Windows development environment setup (PowerShell)
- **`setup-vcpkg-windows.ps1`** - vcpkg setup only (PowerShell)
- **`setup-vcpkg-windows.bat`** - vcpkg setup only (Batch)
### Build Scripts
- **`build-windows.ps1`** - Build YAZE on Windows (PowerShell)
- **`build-windows.bat`** - Build YAZE on Windows (Batch)
### Validation Scripts
- **`validate-windows-build.ps1`** - Validate Windows build environment
### Project Generation
- **`generate-vs-projects.py`** - Generate Visual Studio project files (Cross-platform Python)
- **`generate-vs-projects.ps1`** - Generate Visual Studio project files (PowerShell)
- **`generate-vs-projects.bat`** - Generate Visual Studio project files (Batch)
## Quick Start (Windows)
### Option 1: Automated Setup (Recommended)
```powershell
.\scripts\setup-windows-dev.ps1
```
### Option 2: Manual Setup
```powershell
# 1. Setup vcpkg
.\scripts\setup-vcpkg-windows.ps1
# 2. Generate project files
python scripts/generate-vs-projects.py
# 3. Build
.\scripts\build-windows.ps1
```
### Option 3: Using Batch Scripts
```batch
REM Setup vcpkg
.\scripts\setup-vcpkg-windows.bat
REM Generate project files
python scripts/generate-vs-projects.py
REM Build
.\scripts\build-windows.bat
```
## Script Options
### setup-windows-dev.ps1
- `-SkipVcpkg` - Skip vcpkg setup
- `-SkipVS` - Skip Visual Studio check
- `-SkipBuild` - Skip test build
### build-windows.ps1
- `-Configuration` - Build configuration (Debug, Release, RelWithDebInfo, MinSizeRel)
- `-Platform` - Target platform (x64, x86, ARM64)
- `-Clean` - Clean build directories before building
- `-Verbose` - Verbose build output
### build-windows.bat
- First argument: Configuration (Debug, Release, RelWithDebInfo, MinSizeRel)
- Second argument: Platform (x64, x86, ARM64)
- `clean` - Clean build directories
- `verbose` - Verbose build output
## Examples
```powershell
# Build Release x64 (default)
.\scripts\build-windows.ps1
# Build Debug x64
.\scripts\build-windows.ps1 -Configuration Debug -Platform x64
# Build Release x86
.\scripts\build-windows.ps1 -Configuration Release -Platform x86
# Clean build
.\scripts\build-windows.ps1 -Clean
# Verbose build
.\scripts\build-windows.ps1 -Verbose
# Validate environment
.\scripts\validate-windows-build.ps1
```
```batch
REM Build Release x64 (default)
.\scripts\build-windows.bat
REM Build Debug x64
.\scripts\build-windows.bat Debug x64
REM Build Release x86
.\scripts\build-windows.bat Release x86
REM Clean build
.\scripts\build-windows.bat clean
```
## Troubleshooting
### Common Issues
1. **PowerShell Execution Policy**
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
2. **MSBuild Not Found**
- Install Visual Studio 2022 with C++ workload
- Or add MSBuild to PATH
3. **vcpkg Issues**
- Run `.\scripts\setup-vcpkg-windows.ps1` to reinstall
- Check internet connection for dependency downloads
4. **Python Not Found**
- Install Python 3.8+ from python.org
- Make sure Python is in PATH
### Getting Help
1. Run validation script: `.\scripts\validate-windows-build.ps1`
2. Check the [Windows Development Guide](../docs/windows-development-guide.md)
3. Review build output for specific error messages
## Other Scripts
- **`create_release.sh`** - Create GitHub releases (Linux/macOS)
- **`extract_changelog.py`** - Extract changelog for releases
- **`quality_check.sh`** - Code quality checks (Linux/macOS)
- **`test_asar_integration.py`** - Test Asar integration
- **`agent.sh`** - AI agent helper script (Linux/macOS)

164
scripts/build-windows.bat Normal file
View File

@@ -0,0 +1,164 @@
@echo off
REM YAZE Windows Build Script (Batch Version)
REM This script builds the YAZE project on Windows using MSBuild
setlocal enabledelayedexpansion
REM Parse command line arguments
set BUILD_CONFIG=Release
set BUILD_PLATFORM=x64
set CLEAN_BUILD=0
set VERBOSE=0
:parse_args
if "%~1"=="" goto :args_done
if /i "%~1"=="Debug" set BUILD_CONFIG=Debug
if /i "%~1"=="Release" set BUILD_CONFIG=Release
if /i "%~1"=="RelWithDebInfo" set BUILD_CONFIG=RelWithDebInfo
if /i "%~1"=="MinSizeRel" set BUILD_CONFIG=MinSizeRel
if /i "%~1"=="x64" set BUILD_PLATFORM=x64
if /i "%~1"=="x86" set BUILD_PLATFORM=x86
if /i "%~1"=="ARM64" set BUILD_PLATFORM=ARM64
if /i "%~1"=="clean" set CLEAN_BUILD=1
if /i "%~1"=="verbose" set VERBOSE=1
shift
goto :parse_args
:args_done
echo ========================================
echo YAZE Windows Build Script
echo ========================================
REM Check if we're in the right directory
if not exist "YAZE.sln" (
echo ERROR: YAZE.sln not found. Please run this script from the project root directory.
pause
exit /b 1
)
echo ✓ YAZE.sln found
REM Check for MSBuild
where msbuild >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: MSBuild not found. Please install Visual Studio 2022 or later.
echo Make sure to install the C++ development workload.
pause
exit /b 1
)
echo ✓ MSBuild found
REM Check for vcpkg
if not exist "vcpkg.json" (
echo WARNING: vcpkg.json not found. vcpkg integration may not work properly.
)
echo Build Configuration: %BUILD_CONFIG%
echo Build Platform: %BUILD_PLATFORM%
REM Create build directories
echo Creating build directories...
if not exist "build" mkdir build
if not exist "build\bin" mkdir build\bin
if not exist "build\obj" mkdir build\obj
REM Clean build if requested
if %CLEAN_BUILD%==1 (
echo Cleaning build directories...
if exist "build\bin" rmdir /s /q "build\bin" 2>nul
if exist "build\obj" rmdir /s /q "build\obj" 2>nul
if not exist "build\bin" mkdir build\bin
if not exist "build\obj" mkdir build\obj
echo ✓ Build directories cleaned
)
REM Generate yaze_config.h if it doesn't exist
if not exist "yaze_config.h" (
echo Generating yaze_config.h...
if exist "src\yaze_config.h.in" (
copy "src\yaze_config.h.in" "yaze_config.h" >nul
powershell -Command "(Get-Content 'yaze_config.h') -replace '@yaze_VERSION_MAJOR@', '0' -replace '@yaze_VERSION_MINOR@', '3' -replace '@yaze_VERSION_PATCH@', '1' | Set-Content 'yaze_config.h'"
echo ✓ Generated yaze_config.h
) else (
echo WARNING: yaze_config.h.in not found, creating basic config
echo // yaze config file > yaze_config.h
echo #define YAZE_VERSION_MAJOR 0 >> yaze_config.h
echo #define YAZE_VERSION_MINOR 3 >> yaze_config.h
echo #define YAZE_VERSION_PATCH 1 >> yaze_config.h
)
)
REM Build using MSBuild
echo Building with MSBuild...
set MSBUILD_ARGS=YAZE.sln /p:Configuration=%BUILD_CONFIG% /p:Platform=%BUILD_PLATFORM% /p:VcpkgEnabled=true /p:VcpkgManifestInstall=true /m
if %VERBOSE%==1 (
set MSBUILD_ARGS=%MSBUILD_ARGS% /verbosity:detailed
) else (
set MSBUILD_ARGS=%MSBUILD_ARGS% /verbosity:minimal
)
echo Command: msbuild %MSBUILD_ARGS%
msbuild %MSBUILD_ARGS%
if %errorlevel% neq 0 (
echo ERROR: Build failed with exit code %errorlevel%
pause
exit /b 1
)
echo ✓ Build completed successfully
REM Verify executable was created
set EXE_PATH=build\bin\%BUILD_CONFIG%\yaze.exe
if not exist "%EXE_PATH%" (
echo ERROR: Executable not found at expected path: %EXE_PATH%
pause
exit /b 1
)
echo ✓ Executable created: %EXE_PATH%
REM Test that the executable runs (basic test)
echo Testing executable startup...
"%EXE_PATH%" --help >nul 2>&1
set EXIT_CODE=%errorlevel%
REM Check if it's the test main or app main
"%EXE_PATH%" --help 2>&1 | findstr /i "Google Test" >nul
if %errorlevel% equ 0 (
echo ERROR: Executable is running test main instead of app main!
pause
exit /b 1
)
echo ✓ Executable runs correctly (exit code: %EXIT_CODE%)
REM Display file info
for %%A in ("%EXE_PATH%") do set FILE_SIZE=%%~zA
set /a FILE_SIZE_MB=%FILE_SIZE% / 1024 / 1024
echo Executable size: %FILE_SIZE_MB% MB
echo ========================================
echo ✓ YAZE Windows build completed successfully!
echo ========================================
echo.
echo Build Configuration: %BUILD_CONFIG%
echo Build Platform: %BUILD_PLATFORM%
echo Executable: %EXE_PATH%
echo.
echo To run YAZE:
echo %EXE_PATH%
echo.
echo To build other configurations:
echo %~nx0 Debug x64
echo %~nx0 Release x86
echo %~nx0 RelWithDebInfo ARM64
echo %~nx0 clean
echo.
pause

220
scripts/build-windows.ps1 Normal file
View File

@@ -0,0 +1,220 @@
# YAZE Windows Build Script
# This script builds the YAZE project on Windows using MSBuild
param(
[string]$Configuration = "Release",
[string]$Platform = "x64",
[switch]$Clean,
[switch]$Verbose
)
# Set error handling
$ErrorActionPreference = "Continue"
# Colors for output
$Colors = @{
Success = "Green"
Warning = "Yellow"
Error = "Red"
Info = "Cyan"
White = "White"
}
function Write-Status {
param([string]$Message, [string]$Color = "White")
Write-Host $Message -ForegroundColor $Colors[$Color]
}
function Test-Command {
param([string]$Command)
try {
$null = Get-Command $Command -ErrorAction Stop
return $true
} catch {
return $false
}
}
function Get-MSBuildPath {
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path $vsWhere) {
$vsInstall = & $vsWhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($vsInstall) {
$msbuildPath = Join-Path $vsInstall "MSBuild\Current\Bin\MSBuild.exe"
if (Test-Path $msbuildPath) {
return $msbuildPath
}
}
}
return $null
}
# Main script
Write-Status "========================================" "Info"
Write-Status "YAZE Windows Build Script" "Info"
Write-Status "========================================" "Info"
# Validate parameters
$ValidConfigs = @("Debug", "Release", "RelWithDebInfo", "MinSizeRel")
$ValidPlatforms = @("x64", "x86", "ARM64")
if ($ValidConfigs -notcontains $Configuration) {
Write-Status "ERROR: Invalid configuration '$Configuration'. Valid options: $($ValidConfigs -join ', ')" "Error"
exit 1
}
if ($ValidPlatforms -notcontains $Platform) {
Write-Status "ERROR: Invalid platform '$Platform'. Valid options: $($ValidPlatforms -join ', ')" "Error"
exit 1
}
Write-Status "Build Configuration: $Configuration" "Warning"
Write-Status "Build Platform: $Platform" "Warning"
# Check if we're in the right directory
if (-not (Test-Path "YAZE.sln")) {
Write-Status "ERROR: YAZE.sln not found. Please run this script from the project root directory." "Error"
exit 1
}
Write-Status "✓ Found YAZE.sln" "Success"
# Check for MSBuild
$msbuildPath = Get-MSBuildPath
if (-not $msbuildPath) {
Write-Status "ERROR: MSBuild not found. Please install Visual Studio 2022 with C++ workload." "Error"
exit 1
}
Write-Status "✓ MSBuild found at: $msbuildPath" "Success"
# Check for vcpkg
if (-not (Test-Path "vcpkg.json")) {
Write-Status "WARNING: vcpkg.json not found. vcpkg integration may not work properly." "Warning"
}
# Create build directories
Write-Status "Creating build directories..." "Warning"
$directories = @("build", "build\bin", "build\obj")
foreach ($dir in $directories) {
if (-not (Test-Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force | Out-Null
Write-Status "✓ Created directory: $dir" "Success"
}
}
# Clean build if requested
if ($Clean) {
Write-Status "Cleaning build directories..." "Warning"
if (Test-Path "build\bin") {
Remove-Item -Recurse -Force "build\bin\*" -ErrorAction SilentlyContinue
}
if (Test-Path "build\obj") {
Remove-Item -Recurse -Force "build\obj\*" -ErrorAction SilentlyContinue
}
Write-Status "✓ Build directories cleaned" "Success"
}
# Generate yaze_config.h if it doesn't exist
if (-not (Test-Path "yaze_config.h")) {
Write-Status "Generating yaze_config.h..." "Warning"
if (Test-Path "src\yaze_config.h.in") {
Copy-Item "src\yaze_config.h.in" "yaze_config.h"
$content = Get-Content "yaze_config.h" -Raw
$content = $content -replace '@yaze_VERSION_MAJOR@', '0'
$content = $content -replace '@yaze_VERSION_MINOR@', '3'
$content = $content -replace '@yaze_VERSION_PATCH@', '1'
Set-Content "yaze_config.h" $content
Write-Status "✓ Generated yaze_config.h" "Success"
} else {
Write-Status "WARNING: yaze_config.h.in not found, creating basic config" "Warning"
@"
// yaze config file
#define YAZE_VERSION_MAJOR 0
#define YAZE_VERSION_MINOR 3
#define YAZE_VERSION_PATCH 1
"@ | Out-File -FilePath "yaze_config.h" -Encoding UTF8
}
}
# Build using MSBuild
Write-Status "Building with MSBuild..." "Warning"
$msbuildArgs = @(
"YAZE.sln"
"/p:Configuration=$Configuration"
"/p:Platform=$Platform"
"/p:VcpkgEnabled=true"
"/p:VcpkgManifestInstall=true"
"/m"
)
if ($Verbose) {
$msbuildArgs += "/verbosity:detailed"
} else {
$msbuildArgs += "/verbosity:minimal"
}
$msbuildCommand = "& `"$msbuildPath`" $($msbuildArgs -join ' ')"
Write-Status "Command: $msbuildCommand" "Info"
try {
& $msbuildPath @msbuildArgs
if ($LASTEXITCODE -ne 0) {
throw "MSBuild failed with exit code $LASTEXITCODE"
}
Write-Status "✓ Build completed successfully" "Success"
} catch {
Write-Status "✗ Build failed: $_" "Error"
exit 1
}
# Verify executable was created
$exePath = "build\bin\$Configuration\yaze.exe"
if (-not (Test-Path $exePath)) {
Write-Status "ERROR: Executable not found at expected path: $exePath" "Error"
exit 1
}
Write-Status "✓ Executable created: $exePath" "Success"
# Test that the executable runs
Write-Status "Testing executable..." "Warning"
try {
$testResult = & $exePath --help 2>&1
$exitCode = $LASTEXITCODE
# Check if it's the test main or app main
if ($testResult -match "Google Test|gtest") {
Write-Status "ERROR: Executable is running test main instead of app main!" "Error"
Write-Status "Output: $testResult" "Error"
exit 1
}
Write-Status "✓ Executable runs correctly (exit code: $exitCode)" "Success"
} catch {
Write-Status "WARNING: Could not test executable: $_" "Warning"
}
# Display file info
$exeInfo = Get-Item $exePath
$fileSizeMB = [math]::Round($exeInfo.Length / 1MB, 2)
Write-Status "Executable size: $fileSizeMB MB" "Info"
Write-Status "========================================" "Info"
Write-Status "✓ YAZE Windows build completed successfully!" "Success"
Write-Status "========================================" "Info"
Write-Status ""
Write-Status "Build Configuration: $Configuration" "White"
Write-Status "Build Platform: $Platform" "White"
Write-Status "Executable: $exePath" "White"
Write-Status ""
Write-Status "To run YAZE:" "Warning"
Write-Status " $exePath" "White"
Write-Status ""
Write-Status "To build other configurations:" "Warning"
Write-Status " .\scripts\build-windows.ps1 -Configuration Debug -Platform x64" "White"
Write-Status " .\scripts\build-windows.ps1 -Configuration Release -Platform x86" "White"
Write-Status " .\scripts\build-windows.ps1 -Configuration RelWithDebInfo -Platform ARM64" "White"
Write-Status " .\scripts\build-windows.ps1 -Clean" "White"
Write-Status ""

64
scripts/create-macos-bundle.sh Executable file
View File

@@ -0,0 +1,64 @@
#!/bin/bash
set -e
# Create macOS bundle script
# Usage: create-macos-bundle.sh <version> <artifact_name>
VERSION_NUM="$1"
ARTIFACT_NAME="$2"
if [ -z "$VERSION_NUM" ] || [ -z "$ARTIFACT_NAME" ]; then
echo "Usage: $0 <version> <artifact_name>"
exit 1
fi
echo "Creating macOS bundle for version: $VERSION_NUM"
# macOS packaging
if [ -d "build/bin/yaze.app" ]; then
echo "Found macOS bundle, using it directly"
cp -r build/bin/yaze.app ./Yaze.app
# Add additional resources to the bundle
cp -r assets "Yaze.app/Contents/Resources/" 2>/dev/null || echo "assets directory not found"
# Update Info.plist with correct version
if [ -f "cmake/yaze.plist.in" ]; then
sed "s/@yaze_VERSION@/$VERSION_NUM/g" cmake/yaze.plist.in > "Yaze.app/Contents/Info.plist"
fi
else
echo "No bundle found, creating manual bundle"
mkdir -p "Yaze.app/Contents/MacOS"
mkdir -p "Yaze.app/Contents/Resources"
cp build/bin/yaze "Yaze.app/Contents/MacOS/"
cp -r assets "Yaze.app/Contents/Resources/" 2>/dev/null || echo "assets directory not found"
# Create Info.plist with correct version
cat > "Yaze.app/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>yaze</string>
<key>CFBundleIdentifier</key>
<string>com.yaze.editor</string>
<key>CFBundleName</key>
<string>Yaze</string>
<key>CFBundleVersion</key>
<string>$VERSION_NUM</string>
<key>CFBundleShortVersionString</key>
<string>$VERSION_NUM</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>
EOF
fi
# Create DMG
mkdir dmg_staging
cp -r Yaze.app dmg_staging/
cp LICENSE dmg_staging/ 2>/dev/null || echo "LICENSE not found"
cp README.md dmg_staging/ 2>/dev/null || echo "README.md not found"
cp -r docs dmg_staging/ 2>/dev/null || echo "docs directory not found"
hdiutil create -srcfolder dmg_staging -format UDZO -volname "Yaze v$VERSION_NUM" "$ARTIFACT_NAME.dmg"
echo "macOS bundle creation completed successfully!"

View File

@@ -0,0 +1,328 @@
#!/usr/bin/env python3
"""
Simple Visual Studio project generator for YAZE
This script creates Visual Studio project files without complex CMake dependencies
"""
import os
import sys
from pathlib import Path
def generate_vcxproj():
"""Generate the YAZE.vcxproj file with all source files"""
# Source file lists (from CMake files)
app_core_src = [
"app/core/controller.cc",
"app/emu/emulator.cc",
"app/core/project.cc",
"app/core/window.cc",
"app/core/asar_wrapper.cc",
"app/core/platform/font_loader.cc",
"app/core/platform/clipboard.cc",
"app/core/platform/file_dialog.cc"
]
app_emu_src = [
"app/emu/audio/apu.cc",
"app/emu/audio/spc700.cc",
"app/emu/audio/dsp.cc",
"app/emu/audio/internal/addressing.cc",
"app/emu/audio/internal/instructions.cc",
"app/emu/cpu/internal/addressing.cc",
"app/emu/cpu/internal/instructions.cc",
"app/emu/cpu/cpu.cc",
"app/emu/video/ppu.cc",
"app/emu/memory/dma.cc",
"app/emu/memory/memory.cc",
"app/emu/snes.cc"
]
app_editor_src = [
"app/editor/editor_manager.cc",
"app/editor/dungeon/dungeon_editor.cc",
"app/editor/dungeon/dungeon_room_selector.cc",
"app/editor/dungeon/dungeon_canvas_viewer.cc",
"app/editor/dungeon/dungeon_object_selector.cc",
"app/editor/dungeon/dungeon_toolset.cc",
"app/editor/dungeon/dungeon_object_interaction.cc",
"app/editor/dungeon/dungeon_renderer.cc",
"app/editor/dungeon/dungeon_room_loader.cc",
"app/editor/dungeon/dungeon_usage_tracker.cc",
"app/editor/overworld/overworld_editor.cc",
"app/editor/overworld/overworld_editor_manager.cc",
"app/editor/sprite/sprite_editor.cc",
"app/editor/music/music_editor.cc",
"app/editor/message/message_editor.cc",
"app/editor/message/message_data.cc",
"app/editor/message/message_preview.cc",
"app/editor/code/assembly_editor.cc",
"app/editor/graphics/screen_editor.cc",
"app/editor/graphics/graphics_editor.cc",
"app/editor/graphics/palette_editor.cc",
"app/editor/overworld/tile16_editor.cc",
"app/editor/overworld/map_properties.cc",
"app/editor/graphics/gfx_group_editor.cc",
"app/editor/overworld/entity.cc",
"app/editor/system/settings_editor.cc",
"app/editor/system/command_manager.cc",
"app/editor/system/extension_manager.cc",
"app/editor/system/shortcut_manager.cc",
"app/editor/system/popup_manager.cc",
"app/test/test_manager.cc"
]
app_gfx_src = [
"app/gfx/arena.cc",
"app/gfx/background_buffer.cc",
"app/gfx/bitmap.cc",
"app/gfx/compression.cc",
"app/gfx/scad_format.cc",
"app/gfx/snes_palette.cc",
"app/gfx/snes_tile.cc",
"app/gfx/snes_color.cc",
"app/gfx/tilemap.cc"
]
app_zelda3_src = [
"app/zelda3/hyrule_magic.cc",
"app/zelda3/overworld/overworld_map.cc",
"app/zelda3/overworld/overworld.cc",
"app/zelda3/screen/inventory.cc",
"app/zelda3/screen/title_screen.cc",
"app/zelda3/screen/dungeon_map.cc",
"app/zelda3/sprite/sprite.cc",
"app/zelda3/sprite/sprite_builder.cc",
"app/zelda3/music/tracker.cc",
"app/zelda3/dungeon/room.cc",
"app/zelda3/dungeon/room_object.cc",
"app/zelda3/dungeon/object_parser.cc",
"app/zelda3/dungeon/object_renderer.cc",
"app/zelda3/dungeon/room_layout.cc",
"app/zelda3/dungeon/dungeon_editor_system.cc",
"app/zelda3/dungeon/dungeon_object_editor.cc"
]
gui_src = [
"app/gui/modules/asset_browser.cc",
"app/gui/modules/text_editor.cc",
"app/gui/canvas.cc",
"app/gui/canvas_utils.cc",
"app/gui/enhanced_palette_editor.cc",
"app/gui/input.cc",
"app/gui/style.cc",
"app/gui/color.cc",
"app/gui/zeml.cc",
"app/gui/theme_manager.cc",
"app/gui/background_renderer.cc"
]
util_src = [
"util/bps.cc",
"util/flag.cc",
"util/hex.cc"
]
# Combine all source files
all_source_files = (
["yaze.cc", "app/main.cc", "app/rom.cc"] +
app_core_src + app_emu_src + app_editor_src +
app_gfx_src + app_zelda3_src + gui_src + util_src
)
# Header files
header_files = [
"incl/yaze.h",
"incl/zelda.h",
"src/yaze_config.h.in"
]
# Generate the .vcxproj file content
vcxproj_content = '''<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{B2C3D4E5-F6G7-8901-BCDE-F23456789012}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>YAZE</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>YAZE</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)src;$(ProjectDir)incl;$(ProjectDir)src\\lib;$(ProjectDir)vcpkg\\installed\\x64-windows\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp23</LanguageStandard>
<BigObj>true</BigObj>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProjectDir)vcpkg\\installed\\x64-windows\\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;libpng16.lib;zlib.lib;absl_base.lib;absl_strings.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)src;$(ProjectDir)incl;$(ProjectDir)src\\lib;$(ProjectDir)vcpkg\\installed\\x64-windows\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp23</LanguageStandard>
<BigObj>true</BigObj>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProjectDir)vcpkg\\installed\\x64-windows\\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;libpng16.lib;zlib.lib;absl_base.lib;absl_strings.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
'''
for header in header_files:
vcxproj_content += f' <ClInclude Include="{header}" />\n'
vcxproj_content += ''' </ItemGroup>
<ItemGroup>
'''
for source in all_source_files:
vcxproj_content += f' <ClCompile Include="src\\{source}" />\n'
vcxproj_content += ''' </ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
<None Include="vcpkg.json" />
<None Include="README.md" />
<None Include="LICENSE" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>'''
return vcxproj_content
def generate_solution():
"""Generate the YAZE.sln file"""
return '''Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YAZE", "YAZE.vcxproj", "{B2C3D4E5-F6G7-8901-BCDE-F23456789012}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x64.ActiveCfg = Debug|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x64.Build.0 = Debug|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x64.ActiveCfg = Release|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
EndGlobalSection
EndGlobal'''
def main():
"""Main function to generate Visual Studio project files"""
print("Generating simple Visual Studio project files for YAZE...")
# Get the project root directory
script_dir = Path(__file__).parent
project_root = script_dir.parent
# Generate .vcxproj file
vcxproj_content = generate_vcxproj()
vcxproj_path = project_root / "YAZE.vcxproj"
with open(vcxproj_path, 'w', encoding='utf-8') as f:
f.write(vcxproj_content)
print(f"Generated: {vcxproj_path}")
# Generate .sln file
solution_content = generate_solution()
solution_path = project_root / "YAZE.sln"
with open(solution_path, 'w', encoding='utf-8') as f:
f.write(solution_content)
print(f"Generated: {solution_path}")
print("Visual Studio project files generated successfully!")
print("")
print("IMPORTANT: Before building in Visual Studio:")
print("1. Make sure vcpkg is set up: .\\scripts\\setup-vcpkg-windows.ps1")
print("2. Install dependencies: .\\vcpkg\\vcpkg.exe install --triplet x64-windows")
print("3. Open YAZE.sln in Visual Studio 2022")
print("4. Build the solution (Ctrl+Shift+B)")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,200 @@
@echo off
REM Configure Visual Studio project files for YAZE
REM This script configures CMake build system to work with existing Visual Studio project files
setlocal enabledelayedexpansion
REM Default values
set CONFIGURATION=Debug
set ARCHITECTURE=x64
set CLEAN=false
REM Parse command line arguments
:parse_args
if "%~1"=="" goto :args_done
if "%~1"=="--clean" set CLEAN=true
if "%~1"=="--release" set CONFIGURATION=Release
if "%~1"=="--x86" set ARCHITECTURE=Win32
if "%~1"=="--x64" set ARCHITECTURE=x64
if "%~1"=="--arm64" set ARCHITECTURE=ARM64
shift
goto :parse_args
:args_done
REM Validate architecture
if not "%ARCHITECTURE%"=="x64" if not "%ARCHITECTURE%"=="Win32" if not "%ARCHITECTURE%"=="ARM64" (
echo Invalid architecture: %ARCHITECTURE%
echo Valid architectures: x64, Win32, ARM64
exit /b 1
)
echo Generating Visual Studio project files for YAZE...
REM Check if we're on Windows
if not "%OS%"=="Windows_NT" (
echo This script is designed for Windows. Use CMake presets on other platforms.
echo Available presets:
echo - windows-debug
echo - windows-release
echo - windows-dev
exit /b 1
)
REM Check if CMake is available
where cmake >nul 2>&1
if errorlevel 1 (
REM Try common CMake installation paths
if exist "C:\Program Files\CMake\bin\cmake.exe" (
echo Found CMake at: C:\Program Files\CMake\bin\cmake.exe
set "PATH=%PATH%;C:\Program Files\CMake\bin"
goto :cmake_found
)
if exist "C:\Program Files (x86)\CMake\bin\cmake.exe" (
echo Found CMake at: C:\Program Files (x86)\CMake\bin\cmake.exe
set "PATH=%PATH%;C:\Program Files (x86)\CMake\bin"
goto :cmake_found
)
if exist "C:\cmake\bin\cmake.exe" (
echo Found CMake at: C:\cmake\bin\cmake.exe
set "PATH=%PATH%;C:\cmake\bin"
goto :cmake_found
)
REM If we get here, CMake is not found
echo CMake not found in PATH. Attempting to install...
REM Try to install CMake via Chocolatey
where choco >nul 2>&1
if not errorlevel 1 (
echo Installing CMake via Chocolatey...
choco install -y cmake
if errorlevel 1 (
echo Failed to install CMake via Chocolatey
) else (
echo CMake installed successfully
REM Refresh PATH
call refreshenv
)
) else (
echo Chocolatey not found. Please install CMake manually:
echo 1. Download from: https://cmake.org/download/
echo 2. Or install Chocolatey first: https://chocolatey.org/install
echo 3. Then run: choco install cmake
exit /b 1
)
REM Check again after installation
where cmake >nul 2>&1
if errorlevel 1 (
echo CMake still not found after installation. Please restart your terminal or add CMake to PATH manually.
exit /b 1
)
)
:cmake_found
echo CMake found and ready to use
REM Set up paths
set SOURCE_DIR=%~dp0..
set BUILD_DIR=%SOURCE_DIR%\build-vs
echo Source directory: %SOURCE_DIR%
echo Build directory: %BUILD_DIR%
REM Clean build directory if requested
if "%CLEAN%"=="true" (
if exist "%BUILD_DIR%" (
echo Cleaning build directory...
rmdir /s /q "%BUILD_DIR%"
)
)
REM Create build directory
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
REM Check if vcpkg is available
set VCPKG_PATH=%SOURCE_DIR%\vcpkg\scripts\buildsystems\vcpkg.cmake
if exist "%VCPKG_PATH%" (
echo Using vcpkg toolchain: %VCPKG_PATH%
set USE_VCPKG=true
) else (
echo vcpkg not found, using system libraries
set USE_VCPKG=false
)
REM Build CMake command
set CMAKE_ARGS=-B "%BUILD_DIR%" -G "Visual Studio 17 2022" -A %ARCHITECTURE% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POLICY_VERSION_MAXIMUM=3.28 -DCMAKE_WARN_DEPRECATED=OFF -DABSL_PROPAGATE_CXX_STD=ON -DTHREADS_PREFER_PTHREAD_FLAG=OFF -DYAZE_BUILD_TESTS=ON -DYAZE_BUILD_APP=ON -DYAZE_BUILD_LIB=ON -DYAZE_BUILD_EMU=ON -DYAZE_BUILD_Z3ED=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=ON -DYAZE_ENABLE_UI_TESTS=ON -DYAZE_INSTALL_LIB=OFF
if "%USE_VCPKG%"=="true" (
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PATH%" -DVCPKG_TARGET_TRIPLET=%ARCHITECTURE%-windows -DVCPKG_MANIFEST_MODE=ON
)
REM Run CMake configuration
echo Configuring CMake...
echo Command: cmake %CMAKE_ARGS% "%SOURCE_DIR%"
cmake %CMAKE_ARGS% "%SOURCE_DIR%"
if errorlevel 1 (
echo CMake configuration failed!
exit /b 1
)
REM Check if the existing solution file is present and valid
set EXISTING_SOLUTION_FILE=%SOURCE_DIR%\YAZE.sln
if exist "%EXISTING_SOLUTION_FILE%" (
echo ✅ Using existing Visual Studio solution: %EXISTING_SOLUTION_FILE%
REM Verify the solution file references the project file
findstr /C:"YAZE.vcxproj" "%EXISTING_SOLUTION_FILE%" >nul
if not errorlevel 1 (
echo ✅ Solution file references YAZE.vcxproj correctly
REM Check if project configurations are set up
findstr /C:"ProjectConfigurationPlatforms" "%EXISTING_SOLUTION_FILE%" >nul
if not errorlevel 1 (
echo ✅ Project configurations are properly set up
) else (
echo ⚠️ Warning: Project configurations may not be set up
)
) else (
echo ❌ Solution file does not reference YAZE.vcxproj
echo Please ensure the solution file includes the YAZE project
)
REM Try to open solution in Visual Studio
where devenv >nul 2>&1
if not errorlevel 1 (
echo Opening solution in Visual Studio...
start "" devenv "%EXISTING_SOLUTION_FILE%"
) else (
echo Visual Studio solution ready: %EXISTING_SOLUTION_FILE%
)
) else (
echo ❌ Existing solution file not found: %EXISTING_SOLUTION_FILE%
echo Please ensure YAZE.sln exists in the project root
exit /b 1
)
echo.
echo 🎉 Visual Studio project configuration complete!
echo.
echo Next steps:
echo 1. Open YAZE.sln in Visual Studio
echo 2. Select configuration: %CONFIGURATION%
echo 3. Select platform: %ARCHITECTURE%
echo 4. Build the solution (Ctrl+Shift+B)
echo.
echo Available configurations:
echo - Debug (with debugging symbols)
echo - Release (optimized)
echo - RelWithDebInfo (optimized with debug info)
echo - MinSizeRel (minimum size)
echo.
echo Available architectures:
echo - x64 (64-bit Intel/AMD)
echo - x86 (32-bit Intel/AMD)
echo - ARM64 (64-bit ARM)
pause

View File

@@ -0,0 +1,251 @@
# Configure Visual Studio project files for YAZE
# This script configures CMake build system to work with existing Visual Studio project files
param(
[string]$Configuration = "Debug",
[string]$Architecture = "x64",
[switch]$Clean = $false,
[switch]$UseVcpkg = $false,
[switch]$Help = $false
)
# Show help if requested
if ($Help) {
Write-Host "Usage: .\generate-vs-projects.ps1 [options]"
Write-Host ""
Write-Host "Options:"
Write-Host " -Configuration <config> Build configuration (Debug, Release, RelWithDebInfo, MinSizeRel)"
Write-Host " -Architecture <arch> Target architecture (x64, x86, ARM64)"
Write-Host " -Clean Clean build directory before configuring"
Write-Host " -UseVcpkg Use vcpkg for dependency management"
Write-Host " -Help Show this help message"
Write-Host ""
Write-Host "Examples:"
Write-Host " .\generate-vs-projects.ps1 # Default: Debug x64"
Write-Host " .\generate-vs-projects.ps1 -Configuration Release -Architecture x86"
Write-Host " .\generate-vs-projects.ps1 -Clean -UseVcpkg"
Write-Host ""
Write-Host "Note: This script configures CMake to work with existing YAZE.sln and YAZE.vcxproj files"
exit 0
}
# Validate architecture parameter
$ValidArchitectures = @("x64", "x86", "ARM64")
if ($Architecture -notin $ValidArchitectures) {
Write-Host "Invalid architecture: $Architecture" -ForegroundColor Red
Write-Host "Valid architectures: $($ValidArchitectures -join ', ')" -ForegroundColor Yellow
exit 1
}
Write-Host "Generating Visual Studio project files for YAZE..." -ForegroundColor Green
# Check if we're on Windows
if ($env:OS -ne "Windows_NT") {
Write-Host "This script is designed for Windows. Use CMake presets on other platforms." -ForegroundColor Yellow
Write-Host "Available presets:" -ForegroundColor Cyan
Write-Host " - windows-debug" -ForegroundColor Gray
Write-Host " - windows-release" -ForegroundColor Gray
Write-Host " - windows-dev" -ForegroundColor Gray
exit 1
}
# Check if CMake is available
$cmakePath = Get-Command cmake -ErrorAction SilentlyContinue
if (-not $cmakePath) {
# Try common CMake installation paths
$commonPaths = @(
"C:\Program Files\CMake\bin\cmake.exe",
"C:\Program Files (x86)\CMake\bin\cmake.exe",
"C:\cmake\bin\cmake.exe"
)
foreach ($path in $commonPaths) {
if (Test-Path $path) {
Write-Host "Found CMake at: $path" -ForegroundColor Green
$env:Path += ";$(Split-Path $path)"
$cmakePath = Get-Command cmake -ErrorAction SilentlyContinue
if ($cmakePath) {
break
}
}
}
}
if (-not $cmakePath) {
Write-Host "CMake not found in PATH. Attempting to install..." -ForegroundColor Yellow
# Try to install CMake via Chocolatey
if (Get-Command choco -ErrorAction SilentlyContinue) {
Write-Host "Installing CMake via Chocolatey..." -ForegroundColor Yellow
choco install -y cmake
if ($LASTEXITCODE -eq 0) {
Write-Host "CMake installed successfully" -ForegroundColor Green
# Refresh PATH
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
} else {
Write-Host "Failed to install CMake via Chocolatey" -ForegroundColor Red
}
} else {
Write-Host "Chocolatey not found. Please install CMake manually:" -ForegroundColor Red
Write-Host "1. Download from: https://cmake.org/download/" -ForegroundColor Yellow
Write-Host "2. Or install Chocolatey first: https://chocolatey.org/install" -ForegroundColor Yellow
Write-Host "3. Then run: choco install cmake" -ForegroundColor Yellow
exit 1
}
# Check again after installation
$cmakePath = Get-Command cmake -ErrorAction SilentlyContinue
if (-not $cmakePath) {
Write-Host "CMake still not found after installation. Please restart your terminal or add CMake to PATH manually." -ForegroundColor Red
exit 1
}
}
Write-Host "CMake found: $($cmakePath.Source)" -ForegroundColor Green
# Check if Visual Studio is available
$vsWhere = Get-Command "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -ErrorAction SilentlyContinue
if (-not $vsWhere) {
$vsWhere = Get-Command vswhere -ErrorAction SilentlyContinue
}
if ($vsWhere) {
$vsInstallPath = & $vsWhere.Source -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($vsInstallPath) {
Write-Host "Visual Studio found at: $vsInstallPath" -ForegroundColor Green
} else {
Write-Host "Visual Studio 2022 not found. Please install Visual Studio 2022 with C++ workload." -ForegroundColor Yellow
}
} else {
Write-Host "vswhere not found. Assuming Visual Studio is available." -ForegroundColor Yellow
}
# Set up paths
$SourceDir = Split-Path -Parent $PSScriptRoot
$BuildDir = Join-Path $SourceDir "build-vs"
Write-Host "Source directory: $SourceDir" -ForegroundColor Cyan
Write-Host "Build directory: $BuildDir" -ForegroundColor Cyan
# Clean build directory if requested
if ($Clean -and (Test-Path $BuildDir)) {
Write-Host "Cleaning build directory..." -ForegroundColor Yellow
Remove-Item -Recurse -Force $BuildDir
}
# Create build directory
if (-not (Test-Path $BuildDir)) {
New-Item -ItemType Directory -Path $BuildDir | Out-Null
}
# Check if vcpkg is available
$VcpkgPath = Join-Path $SourceDir "vcpkg\scripts\buildsystems\vcpkg.cmake"
$UseVcpkg = Test-Path $VcpkgPath
if ($UseVcpkg) {
Write-Host "Using vcpkg toolchain: $VcpkgPath" -ForegroundColor Green
} else {
Write-Host "vcpkg not found, using system libraries" -ForegroundColor Yellow
}
# Determine generator and architecture
$Generator = "Visual Studio 17 2022"
$ArchFlag = if ($Architecture -eq "x64") { "-A x64" } else { "-A Win32" }
# Build CMake command
$CmakeArgs = @(
"-B", $BuildDir,
"-G", "`"$Generator`"",
$ArchFlag,
"-DCMAKE_BUILD_TYPE=$Configuration",
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
"-DCMAKE_POLICY_VERSION_MAXIMUM=3.28",
"-DCMAKE_WARN_DEPRECATED=OFF",
"-DABSL_PROPAGATE_CXX_STD=ON",
"-DTHREADS_PREFER_PTHREAD_FLAG=OFF",
"-DYAZE_BUILD_TESTS=ON",
"-DYAZE_BUILD_APP=ON",
"-DYAZE_BUILD_LIB=ON",
"-DYAZE_BUILD_EMU=ON",
"-DYAZE_BUILD_Z3ED=ON",
"-DYAZE_ENABLE_ROM_TESTS=OFF",
"-DYAZE_ENABLE_EXPERIMENTAL_TESTS=ON",
"-DYAZE_ENABLE_UI_TESTS=ON",
"-DYAZE_INSTALL_LIB=OFF"
)
if ($UseVcpkg) {
$CmakeArgs += @(
"-DCMAKE_TOOLCHAIN_FILE=`"$VcpkgPath`"",
"-DVCPKG_TARGET_TRIPLET=$Architecture-windows",
"-DVCPKG_MANIFEST_MODE=ON"
)
}
# Configure CMake to generate build files (but don't overwrite existing project files)
Write-Host "Configuring CMake for build system..." -ForegroundColor Yellow
Write-Host "Command: cmake $($CmakeArgs -join ' ')" -ForegroundColor Gray
& cmake @CmakeArgs $SourceDir
if ($LASTEXITCODE -ne 0) {
Write-Host "CMake configuration failed!" -ForegroundColor Red
exit 1
}
# Check if the existing solution file is present and valid
$ExistingSolutionFile = Join-Path $SourceDir "YAZE.sln"
if (Test-Path $ExistingSolutionFile) {
Write-Host "✅ Using existing Visual Studio solution: $ExistingSolutionFile" -ForegroundColor Green
# Verify the solution file is properly structured
$SolutionContent = Get-Content $ExistingSolutionFile -Raw
if ($SolutionContent -match "YAZE\.vcxproj") {
Write-Host "✅ Solution file references YAZE.vcxproj correctly" -ForegroundColor Green
# Check if project configurations are set up
if ($SolutionContent -match "ProjectConfigurationPlatforms") {
Write-Host "✅ Project configurations are properly set up" -ForegroundColor Green
} else {
Write-Host "⚠️ Warning: Project configurations may not be set up" -ForegroundColor Yellow
}
} else {
Write-Host "❌ Solution file does not reference YAZE.vcxproj" -ForegroundColor Red
Write-Host "Please ensure the solution file includes the YAZE project" -ForegroundColor Yellow
}
# Open solution in Visual Studio if available
if (Get-Command "devenv" -ErrorAction SilentlyContinue) {
Write-Host "Opening solution in Visual Studio..." -ForegroundColor Yellow
& devenv $ExistingSolutionFile
} elseif (Get-Command "code" -ErrorAction SilentlyContinue) {
Write-Host "Opening solution in VS Code..." -ForegroundColor Yellow
& code $ExistingSolutionFile
} else {
Write-Host "Visual Studio solution ready: $ExistingSolutionFile" -ForegroundColor Cyan
}
} else {
Write-Host "❌ Existing solution file not found: $ExistingSolutionFile" -ForegroundColor Red
Write-Host "Please ensure YAZE.sln exists in the project root" -ForegroundColor Yellow
exit 1
}
Write-Host ""
Write-Host "🎉 Visual Studio project configuration complete!" -ForegroundColor Green
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Cyan
Write-Host "1. Open YAZE.sln in Visual Studio" -ForegroundColor White
Write-Host "2. Select configuration: $Configuration" -ForegroundColor White
Write-Host "3. Select platform: $Architecture" -ForegroundColor White
Write-Host "4. Build the solution (Ctrl+Shift+B)" -ForegroundColor White
Write-Host ""
Write-Host "Available configurations:" -ForegroundColor Cyan
Write-Host " - Debug (with debugging symbols)" -ForegroundColor Gray
Write-Host " - Release (optimized)" -ForegroundColor Gray
Write-Host " - RelWithDebInfo (optimized with debug info)" -ForegroundColor Gray
Write-Host " - MinSizeRel (minimum size)" -ForegroundColor Gray
Write-Host ""
Write-Host "Available architectures:" -ForegroundColor Cyan
Write-Host " - x64 (64-bit Intel/AMD)" -ForegroundColor Gray
Write-Host " - x86 (32-bit Intel/AMD)" -ForegroundColor Gray
Write-Host " - ARM64 (64-bit ARM)" -ForegroundColor Gray

View File

@@ -0,0 +1,543 @@
#!/usr/bin/env python3
"""
Python script to generate proper Visual Studio project files for YAZE
This script creates a comprehensive .vcxproj file with all necessary source files
"""
import os
import sys
from pathlib import Path
def generate_vcxproj():
"""Generate the YAZE.vcxproj file with all source files"""
# Source file lists (from CMake files)
app_core_src = [
"app/core/controller.cc",
"app/emu/emulator.cc",
"app/core/project.cc",
"app/core/window.cc",
"app/core/asar_wrapper.cc",
"app/core/platform/font_loader.cc",
"app/core/platform/clipboard.cc",
"app/core/platform/file_dialog.cc"
]
app_emu_src = [
"app/emu/audio/apu.cc",
"app/emu/audio/spc700.cc",
"app/emu/audio/dsp.cc",
"app/emu/audio/internal/addressing.cc",
"app/emu/audio/internal/instructions.cc",
"app/emu/cpu/internal/addressing.cc",
"app/emu/cpu/internal/instructions.cc",
"app/emu/cpu/cpu.cc",
"app/emu/video/ppu.cc",
"app/emu/memory/dma.cc",
"app/emu/memory/memory.cc",
"app/emu/snes.cc"
]
app_editor_src = [
"app/editor/editor_manager.cc",
"app/editor/dungeon/dungeon_editor.cc",
"app/editor/dungeon/dungeon_room_selector.cc",
"app/editor/dungeon/dungeon_canvas_viewer.cc",
"app/editor/dungeon/dungeon_object_selector.cc",
"app/editor/dungeon/dungeon_toolset.cc",
"app/editor/dungeon/dungeon_object_interaction.cc",
"app/editor/dungeon/dungeon_renderer.cc",
"app/editor/dungeon/dungeon_room_loader.cc",
"app/editor/dungeon/dungeon_usage_tracker.cc",
"app/editor/overworld/overworld_editor.cc",
"app/editor/overworld/overworld_editor_manager.cc",
"app/editor/sprite/sprite_editor.cc",
"app/editor/music/music_editor.cc",
"app/editor/message/message_editor.cc",
"app/editor/message/message_data.cc",
"app/editor/message/message_preview.cc",
"app/editor/code/assembly_editor.cc",
"app/editor/graphics/screen_editor.cc",
"app/editor/graphics/graphics_editor.cc",
"app/editor/graphics/palette_editor.cc",
"app/editor/overworld/tile16_editor.cc",
"app/editor/overworld/map_properties.cc",
"app/editor/graphics/gfx_group_editor.cc",
"app/editor/overworld/entity.cc",
"app/editor/system/settings_editor.cc",
"app/editor/system/command_manager.cc",
"app/editor/system/extension_manager.cc",
"app/editor/system/shortcut_manager.cc",
"app/editor/system/popup_manager.cc",
"app/test/test_manager.cc"
]
app_gfx_src = [
"app/gfx/arena.cc",
"app/gfx/background_buffer.cc",
"app/gfx/bitmap.cc",
"app/gfx/compression.cc",
"app/gfx/scad_format.cc",
"app/gfx/snes_palette.cc",
"app/gfx/snes_tile.cc",
"app/gfx/snes_color.cc",
"app/gfx/tilemap.cc"
]
app_zelda3_src = [
"app/zelda3/hyrule_magic.cc",
"app/zelda3/overworld/overworld_map.cc",
"app/zelda3/overworld/overworld.cc",
"app/zelda3/screen/inventory.cc",
"app/zelda3/screen/title_screen.cc",
"app/zelda3/screen/dungeon_map.cc",
"app/zelda3/sprite/sprite.cc",
"app/zelda3/sprite/sprite_builder.cc",
"app/zelda3/music/tracker.cc",
"app/zelda3/dungeon/room.cc",
"app/zelda3/dungeon/room_object.cc",
"app/zelda3/dungeon/object_parser.cc",
"app/zelda3/dungeon/object_renderer.cc",
"app/zelda3/dungeon/room_layout.cc",
"app/zelda3/dungeon/dungeon_editor_system.cc",
"app/zelda3/dungeon/dungeon_object_editor.cc"
]
gui_src = [
"app/gui/modules/asset_browser.cc",
"app/gui/modules/text_editor.cc",
"app/gui/canvas.cc",
"app/gui/canvas_utils.cc",
"app/gui/enhanced_palette_editor.cc",
"app/gui/input.cc",
"app/gui/style.cc",
"app/gui/color.cc",
"app/gui/zeml.cc",
"app/gui/theme_manager.cc",
"app/gui/background_renderer.cc"
]
util_src = [
"util/bps.cc",
"util/flag.cc",
"util/hex.cc"
]
# Combine all source files
all_source_files = (
["yaze.cc", "app/main.cc", "app/rom.cc"] +
app_core_src + app_emu_src + app_editor_src +
app_gfx_src + app_zelda3_src + gui_src + util_src
)
# Header files
header_files = [
"incl/yaze.h",
"incl/zelda.h",
"src/yaze_config.h.in"
]
# Generate the .vcxproj file content
vcxproj_content = '''<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RelWithDebInfo|x64">
<Configuration>RelWithDebInfo</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RelWithDebInfo|x86">
<Configuration>RelWithDebInfo</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RelWithDebInfo|ARM64">
<Configuration>RelWithDebInfo</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="MinSizeRel|x64">
<Configuration>MinSizeRel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="MinSizeRel|x86">
<Configuration>MinSizeRel</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="MinSizeRel|ARM64">
<Configuration>MinSizeRel</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{B2C3D4E5-F6G7-8901-BCDE-F23456789012}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>YAZE</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>YAZE</ProjectName>
<VcpkgEnabled>true</VcpkgEnabled>
<VcpkgManifestInstall>true</VcpkgManifestInstall>
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='ARM64'">arm64-windows</VcpkgTriplet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x86'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x86'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x86'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|ARM64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x86'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|ARM64'">
<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x86'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x86'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\\bin\\$(Configuration)\\</OutDir>
<IntDir>$(SolutionDir)build\\obj\\$(Configuration)\\</IntDir>
</PropertyGroup>'''
# Add compiler and linker settings for all configurations
configurations = ["Debug", "Release", "RelWithDebInfo", "MinSizeRel"]
platforms = ["x64", "x86", "ARM64"]
for config in configurations:
for platform in platforms:
is_debug = (config == "Debug")
debug_flags = "_DEBUG;_CONSOLE;%(PreprocessorDefinitions)" if is_debug else "NDEBUG;_CONSOLE;%(PreprocessorDefinitions)"
link_incremental = "true" if is_debug else "false"
generate_debug_info = "false" if config == "MinSizeRel" else "true"
vcxproj_content += f'''
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='{config}|{platform}'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>{debug_flags}</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)src;$(ProjectDir)incl;$(ProjectDir)src\\lib;$(ProjectDir)src\\lib\\asar\\src;$(ProjectDir)src\\lib\\asar\\src\\asar;$(ProjectDir)src\\lib\\asar\\src\\asar-dll-bindings\\c;$(ProjectDir)src\\lib\\imgui;$(ProjectDir)src\\lib\\imgui_test_engine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp23</LanguageStandard>
<BigObj>true</BigObj>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreaded{"Debug" if is_debug else ""}DLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>{generate_debug_info}</GenerateDebugInformation>
<EnableCOMDATFolding>{"false" if is_debug else "true"}</EnableCOMDATFolding>
<OptimizeReferences>{"false" if is_debug else "true"}</OptimizeReferences>
</Link>
</ItemDefinitionGroup>'''
# Add source files
vcxproj_content += '''
<ItemGroup>
'''
for header in header_files:
vcxproj_content += f' <ClInclude Include="{header}" />\n'
vcxproj_content += ''' </ItemGroup>
<ItemGroup>
'''
for source in all_source_files:
vcxproj_content += f' <ClCompile Include="src\\{source}" />\n'
vcxproj_content += ''' </ItemGroup>
<ItemGroup>
<None Include="CMakeLists.txt" />
<None Include="CMakePresets.json" />
<None Include="vcpkg.json" />
<None Include="README.md" />
<None Include="LICENSE" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>'''
return vcxproj_content
def generate_solution():
"""Generate the YAZE.sln file"""
return '''Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YAZE", "YAZE.vcxproj", "{B2C3D4E5-F6G7-8901-BCDE-F23456789012}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Debug|ARM64 = Debug|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
Release|ARM64 = Release|ARM64
RelWithDebInfo|x64 = RelWithDebInfo|x64
RelWithDebInfo|x86 = RelWithDebInfo|x86
RelWithDebInfo|ARM64 = RelWithDebInfo|ARM64
MinSizeRel|x64 = MinSizeRel|x64
MinSizeRel|x86 = MinSizeRel|x86
MinSizeRel|ARM64 = MinSizeRel|ARM64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x64.ActiveCfg = Debug|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x64.Build.0 = Debug|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x86.ActiveCfg = Debug|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|x86.Build.0 = Debug|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Debug|ARM64.Build.0 = Debug|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x64.ActiveCfg = Release|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x64.Build.0 = Release|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x86.ActiveCfg = Release|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|x86.Build.0 = Release|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|ARM64.ActiveCfg = Release|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.Release|ARM64.Build.0 = Release|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|x86.Build.0 = MinSizeRel|x86
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|ARM64.ActiveCfg = MinSizeRel|ARM64
{B2C3D4E5-F6G7-8901-BCDE-F23456789012}.MinSizeRel|ARM64.Build.0 = MinSizeRel|ARM64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
EndGlobalSection
EndGlobal'''
def main():
"""Main function to generate Visual Studio project files"""
print("Generating Visual Studio project files for YAZE...")
# Get the project root directory
script_dir = Path(__file__).parent
project_root = script_dir.parent
# Generate .vcxproj file
vcxproj_content = generate_vcxproj()
vcxproj_path = project_root / "YAZE.vcxproj"
with open(vcxproj_path, 'w', encoding='utf-8') as f:
f.write(vcxproj_content)
print(f"Generated: {vcxproj_path}")
# Generate .sln file
solution_content = generate_solution()
solution_path = project_root / "YAZE.sln"
with open(solution_path, 'w', encoding='utf-8') as f:
f.write(solution_content)
print(f"Generated: {solution_path}")
print("Visual Studio project files generated successfully!")
print("")
print("To build:")
print("1. Open YAZE.sln in Visual Studio 2022")
print("2. Ensure vcpkg is installed and configured")
print("3. Select your desired configuration (Debug/Release) and platform (x64/x86/ARM64)")
print("4. Build the solution (Ctrl+Shift+B)")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,81 @@
@echo off
REM YAZE vcpkg Setup Script (Batch Version)
REM This script sets up vcpkg for YAZE development on Windows
setlocal enabledelayedexpansion
echo ========================================
echo YAZE vcpkg Setup Script
echo ========================================
REM Check if we're in the right directory
if not exist "vcpkg.json" (
echo ERROR: vcpkg.json not found. Please run this script from the project root directory.
pause
exit /b 1
)
echo ✓ vcpkg.json found
REM Check for Git
where git >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: Git not found. Please install Git for Windows.
echo Download from: https://git-scm.com/download/win
pause
exit /b 1
)
echo ✓ Git found
REM Clone vcpkg if needed
if not exist "vcpkg" (
echo Cloning vcpkg...
git clone https://github.com/Microsoft/vcpkg.git vcpkg
if %errorlevel% neq 0 (
echo ERROR: Failed to clone vcpkg
pause
exit /b 1
)
echo ✓ vcpkg cloned successfully
) else (
echo ✓ vcpkg directory already exists
)
REM Bootstrap vcpkg
if not exist "vcpkg\vcpkg.exe" (
echo Bootstrapping vcpkg...
cd vcpkg
call bootstrap-vcpkg.bat
if %errorlevel% neq 0 (
echo ERROR: Failed to bootstrap vcpkg
cd ..
pause
exit /b 1
)
cd ..
echo ✓ vcpkg bootstrapped successfully
) else (
echo ✓ vcpkg already bootstrapped
)
REM Install dependencies
echo Installing dependencies...
vcpkg\vcpkg.exe install --triplet x64-windows
if %errorlevel% neq 0 (
echo WARNING: Some dependencies may not have installed correctly
) else (
echo ✓ Dependencies installed successfully
)
echo ========================================
echo ✓ vcpkg setup complete!
echo ========================================
echo.
echo You can now build YAZE using:
echo .\scripts\build-windows.ps1
echo or
echo .\scripts\build-windows.bat
echo.
pause

View File

@@ -0,0 +1,106 @@
# YAZE vcpkg Setup Script
# This script sets up vcpkg for YAZE development on Windows
param(
[string]$Triplet = "x64-windows"
)
# Set error handling
$ErrorActionPreference = "Continue"
# Colors for output
$Colors = @{
Success = "Green"
Warning = "Yellow"
Error = "Red"
Info = "Cyan"
White = "White"
}
function Write-Status {
param([string]$Message, [string]$Color = "White")
Write-Host $Message -ForegroundColor $Colors[$Color]
}
function Test-Command {
param([string]$Command)
try {
$null = Get-Command $Command -ErrorAction Stop
return $true
} catch {
return $false
}
}
# Main script
Write-Status "========================================" "Info"
Write-Status "YAZE vcpkg Setup Script" "Info"
Write-Status "========================================" "Info"
Write-Status "Target triplet: $Triplet" "Warning"
# Check if we're in the right directory
if (-not (Test-Path "vcpkg.json")) {
Write-Status "ERROR: vcpkg.json not found. Please run this script from the project root directory." "Error"
exit 1
}
Write-Status "✓ Found vcpkg.json" "Success"
# Check for Git
if (-not (Test-Command "git")) {
Write-Status "ERROR: Git not found. Please install Git for Windows." "Error"
Write-Status "Download from: https://git-scm.com/download/win" "Info"
exit 1
}
Write-Status "✓ Git found" "Success"
# Clone vcpkg if needed
if (-not (Test-Path "vcpkg")) {
Write-Status "Cloning vcpkg..." "Warning"
& git clone https://github.com/Microsoft/vcpkg.git vcpkg
if ($LASTEXITCODE -eq 0) {
Write-Status "✓ vcpkg cloned successfully" "Success"
} else {
Write-Status "✗ Failed to clone vcpkg" "Error"
exit 1
}
} else {
Write-Status "✓ vcpkg directory already exists" "Success"
}
# Bootstrap vcpkg
$vcpkgExe = "vcpkg\vcpkg.exe"
if (-not (Test-Path $vcpkgExe)) {
Write-Status "Bootstrapping vcpkg..." "Warning"
Push-Location vcpkg
& .\bootstrap-vcpkg.bat
if ($LASTEXITCODE -eq 0) {
Write-Status "✓ vcpkg bootstrapped successfully" "Success"
} else {
Write-Status "✗ Failed to bootstrap vcpkg" "Error"
Pop-Location
exit 1
}
Pop-Location
} else {
Write-Status "✓ vcpkg already bootstrapped" "Success"
}
# Install dependencies
Write-Status "Installing dependencies for triplet: $Triplet" "Warning"
& $vcpkgExe install --triplet $Triplet
if ($LASTEXITCODE -eq 0) {
Write-Status "✓ Dependencies installed successfully" "Success"
} else {
Write-Status "⚠ Some dependencies may not have installed correctly" "Warning"
}
Write-Status "========================================" "Info"
Write-Status "✓ vcpkg setup complete!" "Success"
Write-Status "========================================" "Info"
Write-Status ""
Write-Status "You can now build YAZE using:" "Warning"
Write-Status " .\scripts\build-windows.ps1" "White"
Write-Status ""

View File

@@ -0,0 +1,219 @@
# YAZE Windows Development Setup Script
# Sequential approach with no functions and minimal conditionals
param(
[switch]$SkipVcpkg,
[switch]$SkipVS,
[switch]$SkipBuild
)
$ErrorActionPreference = "Continue"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "YAZE Windows Development Setup" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
# Step 1: Check project directory
Write-Host "Step 1: Checking project directory..." -ForegroundColor Yellow
$projectValid = Test-Path "CMakeLists.txt"
switch ($projectValid) {
$true { Write-Host "✓ CMakeLists.txt found" -ForegroundColor Green }
$false {
Write-Host "✗ CMakeLists.txt not found" -ForegroundColor Red
Write-Host "Please run this script from the YAZE project root directory" -ForegroundColor Yellow
exit 1
}
}
# Step 2: Check Visual Studio
Write-Host "Step 2: Checking Visual Studio..." -ForegroundColor Yellow
switch ($SkipVS) {
$true { Write-Host "Skipping Visual Studio check" -ForegroundColor Yellow }
$false {
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsFound = $false
$vsExists = Test-Path $vsWhere
switch ($vsExists) {
$true {
$vsInstall = & $vsWhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
switch ($null -ne $vsInstall) {
$true {
$msbuildPath = Join-Path $vsInstall "MSBuild\Current\Bin\MSBuild.exe"
$vsFound = Test-Path $msbuildPath
}
}
}
}
switch ($vsFound) {
$true { Write-Host "✓ Visual Studio 2022 with C++ workload found" -ForegroundColor Green }
$false {
Write-Host "⚠ Visual Studio 2022 with C++ workload not found" -ForegroundColor Yellow
Write-Host "Please install Visual Studio 2022 with 'Desktop development with C++' workload" -ForegroundColor White
}
}
}
}
# Step 3: Check Git
Write-Host "Step 3: Checking Git..." -ForegroundColor Yellow
$gitFound = $false
try {
$null = Get-Command git -ErrorAction Stop
$gitFound = $true
} catch {
$gitFound = $false
}
switch ($gitFound) {
$true {
$gitVersion = & git --version
Write-Host "✓ Git found: $gitVersion" -ForegroundColor Green
}
$false {
Write-Host "⚠ Git not found" -ForegroundColor Yellow
Write-Host "Please install Git for Windows from: https://git-scm.com/download/win" -ForegroundColor White
}
}
# Step 4: Check Python
Write-Host "Step 4: Checking Python..." -ForegroundColor Yellow
$pythonFound = $false
try {
$null = Get-Command python -ErrorAction Stop
$pythonFound = $true
} catch {
$pythonFound = $false
}
switch ($pythonFound) {
$true {
$pythonVersion = & python --version
Write-Host "✓ Python found: $pythonVersion" -ForegroundColor Green
}
$false {
Write-Host "⚠ Python not found" -ForegroundColor Yellow
Write-Host "Please install Python 3.8+ from: https://www.python.org/downloads/" -ForegroundColor White
}
}
# Step 5: Setup vcpkg
Write-Host "Step 5: Setting up vcpkg..." -ForegroundColor Yellow
switch ($SkipVcpkg) {
$true { Write-Host "Skipping vcpkg setup" -ForegroundColor Yellow }
$false {
# Clone vcpkg
$vcpkgExists = Test-Path "vcpkg"
switch ($vcpkgExists) {
$false {
Write-Host "Cloning vcpkg..." -ForegroundColor Yellow
switch ($gitFound) {
$true {
& git clone https://github.com/Microsoft/vcpkg.git vcpkg
$cloneSuccess = ($LASTEXITCODE -eq 0)
switch ($cloneSuccess) {
$true { Write-Host "✓ vcpkg cloned successfully" -ForegroundColor Green }
$false {
Write-Host "✗ Failed to clone vcpkg" -ForegroundColor Red
exit 1
}
}
}
$false {
Write-Host "✗ Git is required to clone vcpkg" -ForegroundColor Red
exit 1
}
}
}
$true { Write-Host "✓ vcpkg directory already exists" -ForegroundColor Green }
}
# Bootstrap vcpkg
$vcpkgExe = "vcpkg\vcpkg.exe"
$vcpkgBootstrapped = Test-Path $vcpkgExe
switch ($vcpkgBootstrapped) {
$false {
Write-Host "Bootstrapping vcpkg..." -ForegroundColor Yellow
Push-Location vcpkg
& .\bootstrap-vcpkg.bat
$bootstrapSuccess = ($LASTEXITCODE -eq 0)
Pop-Location
switch ($bootstrapSuccess) {
$true { Write-Host "✓ vcpkg bootstrapped successfully" -ForegroundColor Green }
$false {
Write-Host "✗ Failed to bootstrap vcpkg" -ForegroundColor Red
exit 1
}
}
}
$true { Write-Host "✓ vcpkg already bootstrapped" -ForegroundColor Green }
}
# Install dependencies
Write-Host "Installing dependencies..." -ForegroundColor Yellow
& $vcpkgExe install --triplet x64-windows
$installSuccess = ($LASTEXITCODE -eq 0)
switch ($installSuccess) {
$true { Write-Host "✓ Dependencies installed successfully" -ForegroundColor Green }
$false { Write-Host "⚠ Some dependencies may not have installed correctly" -ForegroundColor Yellow }
}
}
}
# Step 6: Generate project files
Write-Host "Step 6: Generating Visual Studio project files..." -ForegroundColor Yellow
switch ($pythonFound) {
$true {
& python scripts/generate-vs-projects-simple.py
$generateSuccess = ($LASTEXITCODE -eq 0)
switch ($generateSuccess) {
$true { Write-Host "✓ Project files generated successfully" -ForegroundColor Green }
$false {
Write-Host "⚠ Failed to generate project files with simple generator, trying original..." -ForegroundColor Yellow
& python scripts/generate-vs-projects.py
$generateSuccess2 = ($LASTEXITCODE -eq 0)
switch ($generateSuccess2) {
$true { Write-Host "✓ Project files generated successfully" -ForegroundColor Green }
$false { Write-Host "⚠ Failed to generate project files" -ForegroundColor Yellow }
}
}
}
}
$false { Write-Host "⚠ Python required to generate project files" -ForegroundColor Yellow }
}
# Step 7: Test build
Write-Host "Step 7: Testing build..." -ForegroundColor Yellow
switch ($SkipBuild) {
$true { Write-Host "Skipping test build" -ForegroundColor Yellow }
$false {
$buildScriptExists = Test-Path "scripts\build-windows.ps1"
switch ($buildScriptExists) {
$true {
& .\scripts\build-windows.ps1 -Configuration Release -Platform x64
$buildSuccess = ($LASTEXITCODE -eq 0)
switch ($buildSuccess) {
$true { Write-Host "✓ Test build successful" -ForegroundColor Green }
$false { Write-Host "⚠ Test build failed, but setup is complete" -ForegroundColor Yellow }
}
}
$false { Write-Host "⚠ Build script not found" -ForegroundColor Yellow }
}
}
}
# Final instructions
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "✓ YAZE Windows development setup complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Yellow
Write-Host "1. Visual Studio project files have been generated" -ForegroundColor White
Write-Host "2. Open YAZE.sln in Visual Studio 2022" -ForegroundColor White
Write-Host "3. Select configuration (Debug/Release) and platform (x64/x86/ARM64)" -ForegroundColor White
Write-Host "4. Build the solution (Ctrl+Shift+B)" -ForegroundColor White
Write-Host ""
Write-Host "Or use command line:" -ForegroundColor Yellow
Write-Host " .\scripts\build-windows.ps1 -Configuration Release -Platform x64" -ForegroundColor White
Write-Host ""
Write-Host "For more information, see docs/windows-development-guide.md" -ForegroundColor Cyan

View File

@@ -0,0 +1,132 @@
# YAZE Windows Build Validation Script
# This script validates that the Windows build environment is properly set up
# Set error handling
$ErrorActionPreference = "Continue"
# Colors for output
$Colors = @{
Success = "Green"
Warning = "Yellow"
Error = "Red"
Info = "Cyan"
White = "White"
}
function Write-Status {
param([string]$Message, [string]$Color = "White")
Write-Host $Message -ForegroundColor $Colors[$Color]
}
function Test-Command {
param([string]$Command)
try {
$null = Get-Command $Command -ErrorAction Stop
return $true
} catch {
return $false
}
}
function Test-VisualStudio {
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path $vsWhere) {
$vsInstall = & $vsWhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($vsInstall) {
$msbuildPath = Join-Path $vsInstall "MSBuild\Current\Bin\MSBuild.exe"
if (Test-Path $msbuildPath) {
return $true
}
}
}
return $false
}
# Main script
Write-Status "========================================" "Info"
Write-Status "YAZE Windows Build Validation" "Info"
Write-Status "========================================" "Info"
$allGood = $true
# Check if we're in the right directory
if (-not (Test-Path "YAZE.sln")) {
Write-Status "✗ YAZE.sln not found" "Error"
$allGood = $false
} else {
Write-Status "✓ YAZE.sln found" "Success"
}
# Check for vcpkg.json
if (-not (Test-Path "vcpkg.json")) {
Write-Status "✗ vcpkg.json not found" "Error"
$allGood = $false
} else {
Write-Status "✓ vcpkg.json found" "Success"
}
# Check for Visual Studio
if (Test-VisualStudio) {
Write-Status "✓ Visual Studio 2022 with C++ workload found" "Success"
} else {
Write-Status "✗ Visual Studio 2022 with C++ workload not found" "Error"
$allGood = $false
}
# Check for Git
if (Test-Command "git") {
$gitVersion = & git --version
Write-Status "✓ Git found: $gitVersion" "Success"
} else {
Write-Status "✗ Git not found" "Error"
$allGood = $false
}
# Check for Python
if (Test-Command "python") {
$pythonVersion = & python --version
Write-Status "✓ Python found: $pythonVersion" "Success"
} else {
Write-Status "✗ Python not found" "Error"
$allGood = $false
}
# Check for vcpkg
if (Test-Path "vcpkg\vcpkg.exe") {
Write-Status "✓ vcpkg found and bootstrapped" "Success"
} else {
Write-Status "✗ vcpkg not found or not bootstrapped" "Error"
$allGood = $false
}
# Check for generated project files
if (Test-Path "YAZE.vcxproj") {
Write-Status "✓ Visual Studio project file found" "Success"
} else {
Write-Status "✗ Visual Studio project file not found" "Error"
Write-Status " Run: python scripts/generate-vs-projects.py" "Info"
$allGood = $false
}
# Check for config file
if (Test-Path "yaze_config.h") {
Write-Status "✓ yaze_config.h found" "Success"
} else {
Write-Status "⚠ yaze_config.h not found (will be generated during build)" "Warning"
}
Write-Status "========================================" "Info"
if ($allGood) {
Write-Status "✓ All checks passed! Build environment is ready." "Success"
Write-Status ""
Write-Status "You can now build YAZE using:" "Warning"
Write-Status " .\scripts\build-windows.ps1" "White"
Write-Status " or" "White"
Write-Status " .\scripts\build-windows.bat" "White"
} else {
Write-Status "✗ Some checks failed. Please fix the issues above." "Error"
Write-Status ""
Write-Status "Run the setup script to fix issues:" "Warning"
Write-Status " .\scripts\setup-windows-dev.ps1" "White"
}
Write-Status "========================================" "Info"