Refactor Visual Studio solution and project files for improved organization and support
- Removed obsolete project entries from the solution file to streamline structure. - Updated YAZE project configuration to enable vcpkg integration and multi-architecture support. - Enhanced build scripts for Windows, including automated setup and testing processes. - Added new documentation for Windows development setup and build instructions.
This commit is contained in:
129
scripts/build-windows.bat
Normal file
129
scripts/build-windows.bat
Normal file
@@ -0,0 +1,129 @@
|
||||
@echo off
|
||||
REM Simple Windows build script for YAZE
|
||||
REM This script sets up the environment and builds the project using Visual Studio
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
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 Visual Studio
|
||||
echo Checking for Visual Studio...
|
||||
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
|
||||
echo Checking for vcpkg...
|
||||
if not exist "vcpkg.json" (
|
||||
echo ERROR: vcpkg.json not found. Please ensure vcpkg is properly configured.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo ✓ vcpkg.json found
|
||||
|
||||
REM Set up environment variables
|
||||
echo Setting up build environment...
|
||||
set BUILD_CONFIG=Release
|
||||
set BUILD_PLATFORM=x64
|
||||
|
||||
REM Allow user to override configuration
|
||||
if "%1" neq "" set BUILD_CONFIG=%1
|
||||
if "%2" neq "" set BUILD_PLATFORM=%2
|
||||
|
||||
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 Generate yaze_config.h if it doesn't exist
|
||||
if not exist "yaze_config.h" (
|
||||
echo Generating yaze_config.h...
|
||||
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
|
||||
)
|
||||
|
||||
REM Build using MSBuild
|
||||
echo Building with MSBuild...
|
||||
echo Command: msbuild YAZE.sln /p:Configuration=%BUILD_CONFIG% /p:Platform=%BUILD_PLATFORM% /p:VcpkgEnabled=true /p:VcpkgManifestInstall=true /m /verbosity:minimal
|
||||
|
||||
msbuild YAZE.sln /p:Configuration=%BUILD_CONFIG% /p:Platform=%BUILD_PLATFORM% /p:VcpkgEnabled=true /p:VcpkgManifestInstall=true /m /verbosity:minimal
|
||||
|
||||
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.
|
||||
|
||||
pause
|
||||
168
scripts/build-windows.ps1
Normal file
168
scripts/build-windows.ps1
Normal file
@@ -0,0 +1,168 @@
|
||||
# PowerShell script to build YAZE on Windows
|
||||
# This script sets up the environment and builds the project using Visual Studio
|
||||
|
||||
param(
|
||||
[string]$Configuration = "Release",
|
||||
[string]$Platform = "x64",
|
||||
[switch]$Clean = $false,
|
||||
[switch]$Verbose = $false
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
Write-Host "YAZE Windows Build Script" -ForegroundColor Cyan
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
|
||||
# Check if we're in the right directory
|
||||
if (-not (Test-Path "YAZE.sln")) {
|
||||
Write-Error "YAZE.sln not found. Please run this script from the project root directory."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ YAZE.sln found" -ForegroundColor Green
|
||||
|
||||
# Check for Visual Studio
|
||||
Write-Host "Checking for Visual Studio..." -ForegroundColor Yellow
|
||||
try {
|
||||
$msbuildPath = Get-Command msbuild -ErrorAction Stop
|
||||
Write-Host "✓ MSBuild found at: $($msbuildPath.Source)" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Error "MSBuild not found. Please install Visual Studio 2022 or later with the C++ development workload."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check for vcpkg
|
||||
Write-Host "Checking for vcpkg..." -ForegroundColor Yellow
|
||||
if (-not (Test-Path "vcpkg.json")) {
|
||||
Write-Error "vcpkg.json not found. Please ensure vcpkg is properly configured."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ vcpkg.json found" -ForegroundColor Green
|
||||
|
||||
# Display build configuration
|
||||
Write-Host "Build Configuration: $Configuration" -ForegroundColor Yellow
|
||||
Write-Host "Build Platform: $Platform" -ForegroundColor Yellow
|
||||
|
||||
# Create build directories
|
||||
Write-Host "Creating build directories..." -ForegroundColor Yellow
|
||||
$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-Host "✓ Created directory: $dir" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
# Clean build if requested
|
||||
if ($Clean) {
|
||||
Write-Host "Cleaning build directories..." -ForegroundColor Yellow
|
||||
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-Host "✓ Build directories cleaned" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Generate yaze_config.h if it doesn't exist
|
||||
if (-not (Test-Path "yaze_config.h")) {
|
||||
Write-Host "Generating yaze_config.h..." -ForegroundColor Yellow
|
||||
if (Test-Path "src\yaze_config.h.in") {
|
||||
Copy-Item "src\yaze_config.h.in" "yaze_config.h"
|
||||
(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'
|
||||
Write-Host "✓ Generated yaze_config.h" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "yaze_config.h.in not found, creating basic config"
|
||||
@"
|
||||
// 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-Host "Building with MSBuild..." -ForegroundColor Yellow
|
||||
|
||||
$msbuildArgs = @(
|
||||
"YAZE.sln"
|
||||
"/p:Configuration=$Configuration"
|
||||
"/p:Platform=$Platform"
|
||||
"/p:VcpkgEnabled=true"
|
||||
"/p:VcpkgManifestInstall=true"
|
||||
"/m" # Multi-processor build
|
||||
)
|
||||
|
||||
if ($Verbose) {
|
||||
$msbuildArgs += "/verbosity:detailed"
|
||||
} else {
|
||||
$msbuildArgs += "/verbosity:minimal"
|
||||
}
|
||||
|
||||
$msbuildCommand = "msbuild $($msbuildArgs -join ' ')"
|
||||
Write-Host "Command: $msbuildCommand" -ForegroundColor Gray
|
||||
|
||||
try {
|
||||
& msbuild @msbuildArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "MSBuild failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
Write-Host "✓ Build completed successfully" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Error "Build failed: $_"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Verify executable was created
|
||||
$exePath = "build\bin\$Configuration\yaze.exe"
|
||||
if (-not (Test-Path $exePath)) {
|
||||
Write-Error "Executable not found at expected path: $exePath"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ Executable created: $exePath" -ForegroundColor Green
|
||||
|
||||
# Test that the executable runs (basic test)
|
||||
Write-Host "Testing executable startup..." -ForegroundColor Yellow
|
||||
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-Error "Executable is running test main instead of app main!"
|
||||
Write-Host "Output: $testResult" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ Executable runs correctly (exit code: $exitCode)" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Warning "Could not test executable: $_"
|
||||
}
|
||||
|
||||
# Display file info
|
||||
$exeInfo = Get-Item $exePath
|
||||
$fileSizeMB = [math]::Round($exeInfo.Length / 1MB, 2)
|
||||
Write-Host "Executable size: $fileSizeMB MB" -ForegroundColor Cyan
|
||||
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
Write-Host "✓ YAZE Windows build completed successfully!" -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Build Configuration: $Configuration" -ForegroundColor White
|
||||
Write-Host "Build Platform: $Platform" -ForegroundColor White
|
||||
Write-Host "Executable: $exePath" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "To run YAZE:" -ForegroundColor Yellow
|
||||
Write-Host " $exePath" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "To build other configurations:" -ForegroundColor Yellow
|
||||
Write-Host " .\scripts\build-windows.ps1 -Configuration Debug -Platform x64" -ForegroundColor White
|
||||
Write-Host " .\scripts\build-windows.ps1 -Configuration Release -Platform x86" -ForegroundColor White
|
||||
Write-Host " .\scripts\build-windows.ps1 -Configuration RelWithDebInfo -Platform ARM64" -ForegroundColor White
|
||||
Write-Host " .\scripts\build-windows.ps1 -Clean" -ForegroundColor White
|
||||
Write-Host ""
|
||||
533
scripts/generate-vs-projects-fixed.ps1
Normal file
533
scripts/generate-vs-projects-fixed.ps1
Normal file
@@ -0,0 +1,533 @@
|
||||
# PowerShell script to generate proper Visual Studio project files for YAZE
|
||||
# This script creates a comprehensive .vcxproj file with all necessary source files
|
||||
|
||||
param(
|
||||
[string]$ProjectRoot = ".",
|
||||
[string]$OutputDir = "."
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "Generating Visual Studio project files for YAZE..." -ForegroundColor Green
|
||||
|
||||
# Source file lists (from CMake files)
|
||||
$AppCoreSrc = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$AppEmuSrc = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$AppEditorSrc = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$AppGfxSrc = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$AppZelda3Src = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$GuiSrc = @(
|
||||
"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"
|
||||
)
|
||||
|
||||
$UtilSrc = @(
|
||||
"util/bps.cc",
|
||||
"util/flag.cc",
|
||||
"util/hex.cc"
|
||||
)
|
||||
|
||||
# Combine all source files
|
||||
$AllSourceFiles = @(
|
||||
"yaze.cc",
|
||||
"app/main.cc",
|
||||
"app/rom.cc"
|
||||
) + $AppCoreSrc + $AppEmuSrc + $AppEditorSrc + $AppGfxSrc + $AppZelda3Src + $GuiSrc + $UtilSrc
|
||||
|
||||
# Header files
|
||||
$HeaderFiles = @(
|
||||
"incl/yaze.h",
|
||||
"incl/zelda.h",
|
||||
"src/yaze_config.h.in"
|
||||
)
|
||||
|
||||
# Generate the .vcxproj file
|
||||
$VcxprojContent = @"
|
||||
<?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>
|
||||
</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")
|
||||
|
||||
foreach ($Config in $Configurations) {
|
||||
foreach ($Platform in $Platforms) {
|
||||
$IsDebug = ($Config -eq "Debug")
|
||||
$DebugFlags = if ($IsDebug) { "_DEBUG;_CONSOLE;%(PreprocessorDefinitions)" } else { "NDEBUG;_CONSOLE;%(PreprocessorDefinitions)" }
|
||||
$LinkIncremental = if ($IsDebug) { "true" } else { "false" }
|
||||
$GenerateDebugInfo = if ($Config -eq "MinSizeRel") { "false" } else { "true" }
|
||||
|
||||
$VcxprojContent += @"
|
||||
|
||||
<ItemDefinitionGroup Condition="'`$(Configuration)|`$(Platform)'=='$Config|$Platform'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>$DebugFlags</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$($IsDebug ? "Debug" : "")DLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>$GenerateDebugInfo</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>$($IsDebug ? "false" : "true")</EnableCOMDATFolding>
|
||||
<OptimizeReferences>$($IsDebug ? "false" : "true")</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
"@
|
||||
}
|
||||
}
|
||||
|
||||
# Add source files
|
||||
$VcxprojContent += @"
|
||||
|
||||
<ItemGroup>
|
||||
"@
|
||||
|
||||
foreach ($Header in $HeaderFiles) {
|
||||
$VcxprojContent += " <ClInclude Include=`"$Header`" />`n"
|
||||
}
|
||||
|
||||
$VcxprojContent += @"
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
"@
|
||||
|
||||
foreach ($Source in $AllSourceFiles) {
|
||||
$VcxprojContent += " <ClCompile Include=`"src\$Source`" />`n"
|
||||
}
|
||||
|
||||
$VcxprojContent += @"
|
||||
</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>
|
||||
"@
|
||||
|
||||
# Write the .vcxproj file
|
||||
$VcxprojPath = Join-Path $OutputDir "YAZE.vcxproj"
|
||||
$VcxprojContent | Out-File -FilePath $VcxprojPath -Encoding UTF8
|
||||
|
||||
Write-Host "Generated: $VcxprojPath" -ForegroundColor Green
|
||||
|
||||
# Generate a simple solution file
|
||||
$SolutionContent = @"
|
||||
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
|
||||
"@
|
||||
|
||||
$SolutionPath = Join-Path $OutputDir "YAZE.sln"
|
||||
$SolutionContent | Out-File -FilePath $SolutionPath -Encoding UTF8
|
||||
|
||||
Write-Host "Generated: $SolutionPath" -ForegroundColor Green
|
||||
Write-Host "Visual Studio project files generated successfully!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "To build:" -ForegroundColor Yellow
|
||||
Write-Host "1. Open YAZE.sln in Visual Studio 2022" -ForegroundColor White
|
||||
Write-Host "2. Ensure vcpkg is installed and configured" -ForegroundColor White
|
||||
Write-Host "3. Select your desired configuration (Debug/Release) and platform (x64/x86/ARM64)" -ForegroundColor White
|
||||
Write-Host "4. Build the solution (Ctrl+Shift+B)" -ForegroundColor White
|
||||
540
scripts/generate-vs-projects.py
Normal file
540
scripts/generate-vs-projects.py
Normal file
@@ -0,0 +1,540 @@
|
||||
#!/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>
|
||||
</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()
|
||||
@@ -1,115 +1,180 @@
|
||||
# Setup script for Windows development environment
|
||||
# This script installs the necessary tools for YAZE development on Windows
|
||||
# PowerShell script to set up Windows development environment for YAZE
|
||||
# This script helps developers get started with building YAZE on Windows
|
||||
|
||||
param(
|
||||
[switch]$Force = $false
|
||||
[switch]$SkipVcpkg = $false,
|
||||
[switch]$SkipVS = $false
|
||||
)
|
||||
|
||||
Write-Host "Setting up Windows development environment for YAZE..." -ForegroundColor Green
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Check if we're on Windows
|
||||
if ($env:OS -ne "Windows_NT") {
|
||||
Write-Host "This script is designed for Windows only." -ForegroundColor Red
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
Write-Host "YAZE Windows Development Setup" -ForegroundColor Cyan
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
|
||||
# Check if we're in the right directory
|
||||
if (-not (Test-Path "YAZE.sln")) {
|
||||
Write-Error "YAZE.sln not found. Please run this script from the project root directory."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if running as administrator
|
||||
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
|
||||
if (-not $isAdmin) {
|
||||
Write-Host "This script requires administrator privileges to install software." -ForegroundColor Yellow
|
||||
Write-Host "Please run PowerShell as Administrator and try again." -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install Chocolatey if not present
|
||||
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
|
||||
Write-Host "Installing Chocolatey package manager..." -ForegroundColor Yellow
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
|
||||
# Refresh environment variables
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
|
||||
Write-Host "Chocolatey installed successfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Chocolatey already installed" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Install required tools
|
||||
$tools = @(
|
||||
@{Name="cmake"; Description="CMake build system"},
|
||||
@{Name="git"; Description="Git version control"},
|
||||
@{Name="ninja"; Description="Ninja build system"},
|
||||
@{Name="python3"; Description="Python 3 for scripts"}
|
||||
)
|
||||
|
||||
foreach ($tool in $tools) {
|
||||
Write-Host "Checking $($tool.Description)..." -ForegroundColor Cyan
|
||||
|
||||
$installed = $false
|
||||
if ($tool.Name -eq "cmake") {
|
||||
$installed = Get-Command cmake -ErrorAction SilentlyContinue
|
||||
} elseif ($tool.Name -eq "git") {
|
||||
$installed = Get-Command git -ErrorAction SilentlyContinue
|
||||
} elseif ($tool.Name -eq "ninja") {
|
||||
$installed = Get-Command ninja -ErrorAction SilentlyContinue
|
||||
} elseif ($tool.Name -eq "python3") {
|
||||
$installed = Get-Command python3 -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
if (-not $installed -or $Force) {
|
||||
Write-Host "Installing $($tool.Description)..." -ForegroundColor Yellow
|
||||
choco install -y $tool.Name
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "$($tool.Description) installed successfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to install $($tool.Description)" -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "$($tool.Description) already installed" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
# Refresh environment variables
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
|
||||
# Verify installations
|
||||
Write-Host "`nVerifying installations..." -ForegroundColor Cyan
|
||||
|
||||
$toolsToVerify = @("cmake", "git", "ninja", "python3")
|
||||
foreach ($tool in $toolsToVerify) {
|
||||
$path = Get-Command $tool -ErrorAction SilentlyContinue
|
||||
if ($path) {
|
||||
Write-Host "✓ $tool found at: $($path.Source)" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ $tool not found" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Write-Host "✓ Found YAZE project files" -ForegroundColor Green
|
||||
|
||||
# Check for Visual Studio
|
||||
Write-Host "`nChecking for Visual Studio..." -ForegroundColor Cyan
|
||||
$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
|
||||
if (-not $SkipVS) {
|
||||
Write-Host "Checking for Visual Studio..." -ForegroundColor Yellow
|
||||
|
||||
$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) {
|
||||
Write-Host "✓ Visual Studio found at: $vsInstall" -ForegroundColor Green
|
||||
|
||||
# Check for MSBuild
|
||||
$msbuildPath = Join-Path $vsInstall "MSBuild\Current\Bin\MSBuild.exe"
|
||||
if (Test-Path $msbuildPath) {
|
||||
Write-Host "✓ MSBuild found" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "MSBuild not found. Please ensure C++ development workload is installed."
|
||||
}
|
||||
} else {
|
||||
Write-Warning "Visual Studio 2022 with C++ workload not found."
|
||||
Write-Host "Please install Visual Studio 2022 with the following workloads:" -ForegroundColor Yellow
|
||||
Write-Host " - Desktop development with C++" -ForegroundColor White
|
||||
Write-Host " - Game development with C++" -ForegroundColor White
|
||||
}
|
||||
} else {
|
||||
Write-Host "✗ Visual Studio 2022 with C++ workload not found" -ForegroundColor Red
|
||||
Write-Host "Please install Visual Studio 2022 with the 'Desktop development with C++' workload" -ForegroundColor Yellow
|
||||
Write-Warning "Visual Studio Installer not found. Please install Visual Studio 2022."
|
||||
}
|
||||
} else {
|
||||
Write-Host "✗ vswhere not found - cannot detect Visual Studio" -ForegroundColor Red
|
||||
Write-Host "Skipping Visual Studio check" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "`n🎉 Windows development environment setup complete!" -ForegroundColor Green
|
||||
Write-Host "`nNext steps:" -ForegroundColor Cyan
|
||||
Write-Host "1. Run the Visual Studio project generation script:" -ForegroundColor White
|
||||
Write-Host " .\scripts\generate-vs-projects.ps1" -ForegroundColor Gray
|
||||
Write-Host "2. Or use CMake presets:" -ForegroundColor White
|
||||
Write-Host " cmake --preset windows-debug" -ForegroundColor Gray
|
||||
Write-Host "3. Open YAZE.sln in Visual Studio and build" -ForegroundColor White
|
||||
# Check for Git
|
||||
Write-Host "Checking for Git..." -ForegroundColor Yellow
|
||||
try {
|
||||
$gitVersion = & git --version 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Git found: $gitVersion" -ForegroundColor Green
|
||||
} else {
|
||||
throw "Git not found"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Git not found. Please install Git for Windows."
|
||||
Write-Host "Download from: https://git-scm.com/download/win" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Check for Python
|
||||
Write-Host "Checking for Python..." -ForegroundColor Yellow
|
||||
try {
|
||||
$pythonVersion = & python --version 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Python found: $pythonVersion" -ForegroundColor Green
|
||||
} else {
|
||||
throw "Python not found"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Python not found. Please install Python 3.8 or later."
|
||||
Write-Host "Download from: https://www.python.org/downloads/" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Set up vcpkg
|
||||
if (-not $SkipVcpkg) {
|
||||
Write-Host "Setting up vcpkg..." -ForegroundColor Yellow
|
||||
|
||||
if (-not (Test-Path "vcpkg")) {
|
||||
Write-Host "Cloning vcpkg..." -ForegroundColor Yellow
|
||||
try {
|
||||
& git clone https://github.com/Microsoft/vcpkg.git vcpkg
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ vcpkg cloned successfully" -ForegroundColor Green
|
||||
} else {
|
||||
throw "Failed to clone vcpkg"
|
||||
}
|
||||
} catch {
|
||||
Write-Error "Failed to clone vcpkg: $_"
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "✓ vcpkg directory already exists" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Bootstrap vcpkg
|
||||
$vcpkgExe = "vcpkg\vcpkg.exe"
|
||||
if (-not (Test-Path $vcpkgExe)) {
|
||||
Write-Host "Bootstrapping vcpkg..." -ForegroundColor Yellow
|
||||
try {
|
||||
Push-Location vcpkg
|
||||
& .\bootstrap-vcpkg.bat
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ vcpkg bootstrapped successfully" -ForegroundColor Green
|
||||
} else {
|
||||
throw "Failed to bootstrap vcpkg"
|
||||
}
|
||||
Pop-Location
|
||||
} catch {
|
||||
Pop-Location
|
||||
Write-Error "Failed to bootstrap vcpkg: $_"
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "✓ vcpkg already bootstrapped" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Install dependencies
|
||||
Write-Host "Installing dependencies with vcpkg..." -ForegroundColor Yellow
|
||||
try {
|
||||
& $vcpkgExe install --triplet x64-windows
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Dependencies installed successfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "Some dependencies may not have installed correctly"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Failed to install dependencies: $_"
|
||||
}
|
||||
} else {
|
||||
Write-Host "Skipping vcpkg setup" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Generate Visual Studio project files
|
||||
Write-Host "Generating Visual Studio project files..." -ForegroundColor Yellow
|
||||
try {
|
||||
& python scripts/generate-vs-projects.py
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Visual Studio project files generated" -ForegroundColor Green
|
||||
} else {
|
||||
throw "Failed to generate project files"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Failed to generate project files: $_"
|
||||
Write-Host "You can manually run: python scripts/generate-vs-projects.py" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Test build
|
||||
Write-Host "Testing build..." -ForegroundColor Yellow
|
||||
try {
|
||||
& .\scripts\build-windows.ps1 -Configuration Release -Platform x64
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Test build successful" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "Test build failed, but setup is complete"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Test build failed: $_"
|
||||
Write-Host "You can manually run: .\scripts\build-windows.ps1" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
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. Open YAZE.sln in Visual Studio 2022" -ForegroundColor White
|
||||
Write-Host "2. Select your desired configuration (Debug/Release) and platform (x64/x86/ARM64)" -ForegroundColor White
|
||||
Write-Host "3. Build the solution (Ctrl+Shift+B)" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "Or use the 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/02-build-instructions.md" -ForegroundColor Yellow
|
||||
Reference in New Issue
Block a user