Merge remote-tracking branch 'origin/develop' into claude/debug-ci-build-failures-011CUmiMP8xwyFa1kdhkJGaX
This commit is contained in:
@@ -76,4 +76,4 @@ endif()
|
||||
message(STATUS "=================================")
|
||||
|
||||
# Export all dependency targets for use in other CMake files
|
||||
set(YAZE_ALL_DEPENDENCIES ${YAZE_ALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
set(YAZE_ALL_DEPENDENCIES ${YAZE_ALL_DEPENDENCIES})
|
||||
@@ -11,6 +11,7 @@ set(YAML_CPP_VERSION "0.8.0" CACHE STRING "yaml-cpp version")
|
||||
set(GRPC_VERSION "1.67.1" CACHE STRING "gRPC version - MSVC compatible")
|
||||
set(PROTOBUF_VERSION "3.25.1" CACHE STRING "Protobuf version")
|
||||
set(ABSEIL_VERSION "20240116.0" CACHE STRING "Abseil version")
|
||||
# Cache revision: increment to force CPM cache invalidation (current: 2)
|
||||
|
||||
# Testing
|
||||
set(GTEST_VERSION "1.14.0" CACHE STRING "Google Test version")
|
||||
@@ -21,6 +22,7 @@ set(FTXUI_VERSION "5.0.0" CACHE STRING "FTXUI version")
|
||||
|
||||
# ImGui
|
||||
set(IMGUI_VERSION "1.90.4" CACHE STRING "Dear ImGui version")
|
||||
# Cache revision: increment to force rebuild (current: 2)
|
||||
|
||||
# ASAR
|
||||
set(ASAR_VERSION "main" CACHE STRING "ASAR version")
|
||||
|
||||
@@ -58,11 +58,14 @@ set(utf8_range_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(utf8_range_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# Use CPM to fetch gRPC with bundled dependencies
|
||||
# GIT_SUBMODULES "" disables submodule recursion since gRPC handles its own deps via CMake
|
||||
CPMAddPackage(
|
||||
NAME grpc
|
||||
VERSION ${GRPC_VERSION}
|
||||
GITHUB_REPOSITORY grpc/grpc
|
||||
GIT_TAG v${GRPC_VERSION}
|
||||
GIT_SUBMODULES ""
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
|
||||
# Check which target naming convention is used
|
||||
@@ -110,7 +113,6 @@ set(ABSL_TARGETS
|
||||
absl::str_format
|
||||
absl::synchronization
|
||||
absl::time
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
# Export gRPC targets for use in other CMake files
|
||||
@@ -120,7 +122,6 @@ set(YAZE_GRPC_TARGETS
|
||||
protobuf::libprotobuf
|
||||
protoc
|
||||
grpc_cpp_plugin
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
message(STATUS "gRPC setup complete - targets available: ${YAZE_GRPC_TARGETS}")
|
||||
@@ -149,7 +150,6 @@ message(STATUS "Protobuf include dir: ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}")
|
||||
# Export protobuf targets
|
||||
set(YAZE_PROTOBUF_TARGETS
|
||||
protobuf::libprotobuf
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
# Function to add protobuf/gRPC code generation to a target
|
||||
|
||||
@@ -25,6 +25,9 @@ target_include_directories(ImGui PUBLIC
|
||||
${IMGUI_DIR}/backends
|
||||
)
|
||||
|
||||
# Set C++ standard requirement (ImGui 1.90+ requires C++11, we use C++17 for consistency)
|
||||
target_compile_features(ImGui PUBLIC cxx_std_17)
|
||||
|
||||
# Link to SDL2
|
||||
target_link_libraries(ImGui PUBLIC ${YAZE_SDL2_TARGETS})
|
||||
|
||||
@@ -52,6 +55,7 @@ if(YAZE_BUILD_TESTS)
|
||||
${IMGUI_TEST_ENGINE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
)
|
||||
target_compile_features(ImGuiTestEngine PUBLIC cxx_std_17)
|
||||
target_link_libraries(ImGuiTestEngine PUBLIC ImGui ${YAZE_SDL2_TARGETS})
|
||||
target_compile_definitions(ImGuiTestEngine PUBLIC
|
||||
IMGUI_ENABLE_TEST_ENGINE=1
|
||||
@@ -63,7 +67,6 @@ if(YAZE_BUILD_TESTS)
|
||||
endif()
|
||||
|
||||
# Export ImGui targets for use in other CMake files
|
||||
set(YAZE_IMGUI_TARGETS ImGui PARENT_SCOPE)
|
||||
set(YAZE_IMGUI_TARGETS ImGui)
|
||||
|
||||
message(STATUS "Dear ImGui setup complete - YAZE_IMGUI_TARGETS = ${YAZE_IMGUI_TARGETS}")
|
||||
|
||||
@@ -96,9 +96,6 @@ elseif(UNIX)
|
||||
endif()
|
||||
|
||||
# Export SDL2 targets for use in other CMake files
|
||||
# Use PARENT_SCOPE to set in the calling scope (dependencies.cmake)
|
||||
set(YAZE_SDL2_TARGETS yaze_sdl2 PARENT_SCOPE)
|
||||
# Also set locally for use in this file
|
||||
set(YAZE_SDL2_TARGETS yaze_sdl2)
|
||||
|
||||
message(STATUS "SDL2 setup complete - YAZE_SDL2_TARGETS = ${YAZE_SDL2_TARGETS}")
|
||||
|
||||
@@ -47,7 +47,7 @@ if(YAZE_ENABLE_COVERAGE OR DEFINED ENV{YAZE_ENABLE_BENCHMARKS})
|
||||
message(FATAL_ERROR "Benchmark target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
set(YAZE_BENCHMARK_TARGETS benchmark::benchmark PARENT_SCOPE)
|
||||
set(YAZE_BENCHMARK_TARGETS benchmark::benchmark)
|
||||
endif()
|
||||
|
||||
# Create convenience targets for the rest of the project
|
||||
@@ -64,7 +64,6 @@ if(TARGET benchmark::benchmark)
|
||||
endif()
|
||||
|
||||
# Export testing targets for use in other CMake files
|
||||
set(YAZE_TESTING_TARGETS yaze_testing PARENT_SCOPE)
|
||||
set(YAZE_TESTING_TARGETS yaze_testing)
|
||||
|
||||
message(STATUS "Testing dependencies setup complete - GTest + GMock available")
|
||||
|
||||
@@ -13,7 +13,7 @@ if(YAZE_USE_SYSTEM_DEPS)
|
||||
message(STATUS "Using system yaml-cpp")
|
||||
add_library(yaze_yaml INTERFACE IMPORTED)
|
||||
target_link_libraries(yaze_yaml INTERFACE yaml-cpp)
|
||||
set(YAZE_YAML_TARGETS yaze_yaml PARENT_SCOPE)
|
||||
set(YAZE_YAML_TARGETS yaze_yaml)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# gui libraries ---------------------------------------------------------------
|
||||
set(IMGUI_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui)
|
||||
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
||||
set(IMGUI_BACKEND_SOURCES
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdl2.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdlrenderer2.cpp
|
||||
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
|
||||
)
|
||||
add_library("ImGui" STATIC ${IMGUI_SOURCES} ${IMGUI_BACKEND_SOURCES})
|
||||
target_include_directories("ImGui" PUBLIC ${IMGUI_PATH} ${IMGUI_PATH}/backends)
|
||||
target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR})
|
||||
target_compile_definitions(ImGui PUBLIC
|
||||
IMGUI_IMPL_OPENGL_LOADER_CUSTOM=<SDL2/SDL_opengl.h> GL_GLEXT_PROTOTYPES=1)
|
||||
|
||||
# ImGui Test Engine - Always built when tests are enabled for simplified integration
|
||||
# The test infrastructure is tightly coupled with the editor, so we always include it
|
||||
if(YAZE_BUILD_TESTS)
|
||||
set(IMGUI_TEST_ENGINE_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine/imgui_test_engine)
|
||||
file(GLOB IMGUI_TEST_ENGINE_SOURCES ${IMGUI_TEST_ENGINE_PATH}/*.cpp)
|
||||
add_library("ImGuiTestEngine" STATIC ${IMGUI_TEST_ENGINE_SOURCES})
|
||||
target_include_directories(ImGuiTestEngine PUBLIC ${IMGUI_PATH} ${CMAKE_SOURCE_DIR}/src/lib)
|
||||
target_link_libraries(ImGuiTestEngine PUBLIC ImGui)
|
||||
target_compile_definitions(ImGuiTestEngine PUBLIC
|
||||
IMGUI_ENABLE_TEST_ENGINE=1
|
||||
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1)
|
||||
|
||||
message(STATUS "✓ ImGui Test Engine enabled (tests are ON)")
|
||||
else()
|
||||
message(STATUS "✗ ImGui Test Engine disabled (tests are OFF)")
|
||||
endif()
|
||||
|
||||
set(
|
||||
IMGUI_SRC
|
||||
${IMGUI_PATH}/imgui.cpp
|
||||
${IMGUI_PATH}/imgui_demo.cpp
|
||||
${IMGUI_PATH}/imgui_draw.cpp
|
||||
${IMGUI_PATH}/imgui_widgets.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdl2.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdlrenderer2.cpp
|
||||
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
|
||||
)
|
||||
|
||||
@@ -202,7 +202,7 @@ function Clean-CMakeCache {
|
||||
$cleaned = $true
|
||||
Write-Status " ✓ Removed '$dir'" "Success"
|
||||
} catch {
|
||||
Write-Status " ✗ Failed to remove '$dir`: $_" "Error"
|
||||
Write-Status " ✗ Failed to remove '$dir': $_" "Error"
|
||||
$script:warnings += "Could not fully clean '$dir' (some files may be locked)"
|
||||
}
|
||||
}
|
||||
@@ -260,6 +260,181 @@ function Sync-GitSubmodules {
|
||||
}
|
||||
}
|
||||
|
||||
function Test-Ninja {
|
||||
Write-Status "Checking Ninja build system..." "Step"
|
||||
if (Test-Command "ninja") {
|
||||
try {
|
||||
$ninjaVersion = & ninja --version 2>&1
|
||||
Write-Status "Ninja found: version $ninjaVersion" "Success"
|
||||
$script:success += "Ninja build system available (required for win-dbg presets)"
|
||||
return $true
|
||||
} catch {
|
||||
Write-Status "Ninja command exists but version check failed" "Warning"
|
||||
return $true
|
||||
}
|
||||
} else {
|
||||
Write-Status "Ninja not found in PATH" "Warning"
|
||||
$script:warnings += "Ninja not installed. Required for win-dbg, win-rel, win-ai presets. Use win-vs-* presets instead or install Ninja."
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Test-NASM {
|
||||
Write-Status "Checking NASM assembler..." "Step"
|
||||
if (Test-Command "nasm") {
|
||||
try {
|
||||
$nasmVersion = & nasm -version 2>&1 | Select-Object -First 1
|
||||
Write-Status "NASM found: $nasmVersion" "Success"
|
||||
$script:success += "NASM assembler available (needed for BoringSSL in gRPC)"
|
||||
return $true
|
||||
} catch {
|
||||
Write-Status "NASM command exists but version check failed" "Warning"
|
||||
return $true
|
||||
}
|
||||
} else {
|
||||
Write-Status "NASM not found in PATH (optional)" "Info"
|
||||
Write-Status "NASM is required for gRPC builds with BoringSSL. Install via: choco install nasm" "Info"
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Test-VSCode {
|
||||
Write-Status "Checking Visual Studio Code installation..." "Step"
|
||||
|
||||
# Check for VSCode in common locations
|
||||
$vscodeLocations = @(
|
||||
"$env:LOCALAPPDATA\Programs\Microsoft VS Code\Code.exe",
|
||||
"$env:ProgramFiles\Microsoft VS Code\Code.exe",
|
||||
"$env:ProgramFiles(x86)\Microsoft VS Code\Code.exe"
|
||||
)
|
||||
|
||||
$vscodeFound = $false
|
||||
$vscodePath = $null
|
||||
|
||||
foreach ($location in $vscodeLocations) {
|
||||
if (Test-Path $location) {
|
||||
$vscodeFound = $true
|
||||
$vscodePath = $location
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $vscodeFound) {
|
||||
# Try to find it via command
|
||||
if (Test-Command "code") {
|
||||
$vscodeFound = $true
|
||||
$vscodePath = (Get-Command code).Source
|
||||
}
|
||||
}
|
||||
|
||||
if ($vscodeFound) {
|
||||
Write-Status "VS Code found: $vscodePath" "Success"
|
||||
|
||||
# Check for CMake Tools extension
|
||||
$extensionsOutput = & code --list-extensions 2>&1
|
||||
if ($extensionsOutput -match "ms-vscode.cmake-tools") {
|
||||
Write-Status "VS Code CMake Tools extension installed" "Success"
|
||||
$script:success += "VS Code with CMake Tools ready for development"
|
||||
} else {
|
||||
Write-Status "VS Code found but CMake Tools extension not installed" "Warning"
|
||||
$script:warnings += "Install CMake Tools extension: code --install-extension ms-vscode.cmake-tools"
|
||||
}
|
||||
return $true
|
||||
} else {
|
||||
Write-Status "VS Code not found (optional)" "Info"
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Test-CMakePresets {
|
||||
Write-Status "Validating CMakePresets.json..." "Step"
|
||||
|
||||
$presetsPath = Join-Path $PSScriptRoot ".." "CMakePresets.json"
|
||||
|
||||
if (-not (Test-Path $presetsPath)) {
|
||||
Write-Status "CMakePresets.json not found!" "Error"
|
||||
$script:issuesFound += "CMakePresets.json missing from repository"
|
||||
return $false
|
||||
}
|
||||
|
||||
try {
|
||||
$presets = Get-Content $presetsPath -Raw | ConvertFrom-Json
|
||||
$configurePresets = $presets.configurePresets | Where-Object { $_.name -like "win-*" }
|
||||
|
||||
if ($configurePresets.Count -eq 0) {
|
||||
Write-Status "No Windows presets found in CMakePresets.json" "Error"
|
||||
$script:issuesFound += "CMakePresets.json has no Windows presets (win-dbg, win-rel, etc.)"
|
||||
return $false
|
||||
}
|
||||
|
||||
Write-Status "CMakePresets.json valid with $($configurePresets.Count) Windows presets" "Success"
|
||||
|
||||
# List available presets if verbose
|
||||
if ($Verbose) {
|
||||
Write-Status "Available Windows presets:" "Info"
|
||||
foreach ($preset in $configurePresets) {
|
||||
Write-Host " - $($preset.name): $($preset.description)" -ForegroundColor Gray
|
||||
}
|
||||
}
|
||||
|
||||
$script:success += "CMakePresets.json contains Windows build configurations"
|
||||
return $true
|
||||
|
||||
} catch {
|
||||
Write-Status "Failed to parse CMakePresets.json: $_" "Error"
|
||||
$script:issuesFound += "CMakePresets.json is invalid or corrupted"
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Test-VisualStudioComponents {
|
||||
Write-Status "Checking Visual Studio C++ components..." "Step"
|
||||
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if (-not (Test-Path $vswhere)) {
|
||||
return $false
|
||||
}
|
||||
|
||||
# Check for specific components needed for C++
|
||||
$requiredComponents = @(
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK"
|
||||
)
|
||||
|
||||
$recommendedComponents = @(
|
||||
"Microsoft.VisualStudio.Component.VC.CMake.Project",
|
||||
"Microsoft.VisualStudio.Component.VC.Llvm.Clang",
|
||||
"Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset"
|
||||
)
|
||||
|
||||
$allComponentsPresent = $true
|
||||
|
||||
foreach ($component in $requiredComponents) {
|
||||
$result = & $vswhere -latest -requires $component -format value -property instanceId 2>&1
|
||||
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($result)) {
|
||||
Write-Status "Missing required component: $component" "Error"
|
||||
$script:issuesFound += "Visual Studio component not installed: $component"
|
||||
$allComponentsPresent = $false
|
||||
} elseif ($Verbose) {
|
||||
Write-Status "Component installed: $component" "Success"
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($component in $recommendedComponents) {
|
||||
$result = & $vswhere -latest -requires $component -format value -property instanceId 2>&1
|
||||
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($result)) {
|
||||
Write-Status "Recommended component not installed: $component" "Info"
|
||||
if ($component -match "CMake") {
|
||||
$script:warnings += "Visual Studio CMake support not installed (recommended for IDE integration)"
|
||||
}
|
||||
} elseif ($Verbose) {
|
||||
Write-Status "Recommended component installed: $component" "Success"
|
||||
}
|
||||
}
|
||||
|
||||
return $allComponentsPresent
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Main Verification Process
|
||||
# ============================================================================
|
||||
@@ -317,7 +492,11 @@ if (Test-Command "git") {
|
||||
$script:issuesFound += "Git not installed or not in PATH"
|
||||
}
|
||||
|
||||
# Step 3: Check Visual Studio
|
||||
# Step 3: Check Build Tools (Ninja and NASM)
|
||||
Test-Ninja | Out-Null
|
||||
Test-NASM | Out-Null
|
||||
|
||||
# Step 4: Check Visual Studio
|
||||
Write-Status "Checking Visual Studio installation..." "Step"
|
||||
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if (Test-Path $vswhere) {
|
||||
@@ -329,6 +508,9 @@ if (Test-Path $vswhere) {
|
||||
Write-Status "Visual Studio with C++ Desktop workload found: version $vsVersion" "Success"
|
||||
Write-Status " Path: $vsPath" "Info"
|
||||
$script:success += "Visual Studio C++ workload detected (version $vsVersion)"
|
||||
|
||||
# Check for detailed components
|
||||
Test-VisualStudioComponents | Out-Null
|
||||
} else {
|
||||
Write-Status "Visual Studio found, but 'Desktop development with C++' workload is missing." "Error"
|
||||
$script:issuesFound += "Visual Studio 'Desktop development with C++' workload not installed."
|
||||
@@ -338,10 +520,16 @@ if (Test-Path $vswhere) {
|
||||
$script:issuesFound += "Visual Studio installation not detected."
|
||||
}
|
||||
|
||||
# Step 4: Check vcpkg
|
||||
# Step 5: Check VSCode (optional)
|
||||
Test-VSCode | Out-Null
|
||||
|
||||
# Step 6: Check CMakePresets.json
|
||||
Test-CMakePresets | Out-Null
|
||||
|
||||
# Step 7: Check vcpkg
|
||||
Test-Vcpkg | Out-Null
|
||||
|
||||
# Step 5: Check Git Submodules
|
||||
# Step 8: Check Git Submodules
|
||||
Write-Status "Checking git submodules..." "Step"
|
||||
$submodulesOk = Test-GitSubmodules
|
||||
if ($submodulesOk) {
|
||||
@@ -359,7 +547,7 @@ if ($submodulesOk) {
|
||||
}
|
||||
}
|
||||
|
||||
# Step 6: Check CMake Cache
|
||||
# Step 9: Check CMake Cache
|
||||
Write-Status "Checking CMake cache..." "Step"
|
||||
if (Test-CMakeCache) {
|
||||
Write-Status "CMake cache appears up to date." "Success"
|
||||
@@ -438,6 +626,24 @@ if ($script:issuesFound.Count -gt 0) {
|
||||
Write-Host " git config --global core.longpaths true" -ForegroundColor Gray
|
||||
Write-Host " Or, run this script again with the '-FixIssues' flag.`n"
|
||||
}
|
||||
if ($script:warnings -join ' ' -match 'Ninja') {
|
||||
Write-Host " • Ninja build system:" -ForegroundColor White
|
||||
Write-Host " Ninja is required for win-dbg, win-rel, and win-ai presets." -ForegroundColor Gray
|
||||
Write-Host " Install via Chocolatey: choco install ninja" -ForegroundColor Gray
|
||||
Write-Host " Or use win-vs-* presets which use Visual Studio generator instead.`n"
|
||||
}
|
||||
if ($script:warnings -join ' ' -match 'CMake Tools') {
|
||||
Write-Host " • VS Code CMake Tools extension:" -ForegroundColor White
|
||||
Write-Host " For VS Code integration, install the CMake Tools extension:" -ForegroundColor Gray
|
||||
Write-Host " code --install-extension ms-vscode.cmake-tools" -ForegroundColor Gray
|
||||
Write-Host " Or install manually from the Extensions panel.`n"
|
||||
}
|
||||
if ($script:issuesFound -join ' ' -match 'CMakePresets') {
|
||||
Write-Host " • CMakePresets.json missing or invalid:" -ForegroundColor White
|
||||
Write-Host " This file is required for preset-based builds." -ForegroundColor Gray
|
||||
Write-Host " Ensure you're in the yaze repository root and the file exists." -ForegroundColor Gray
|
||||
Write-Host " Pull latest changes from git to get the updated presets.`n"
|
||||
}
|
||||
|
||||
Write-Host "If problems persist, check the build instructions in 'docs/B1-build-instructions.md'`n" -ForegroundColor Cyan
|
||||
|
||||
@@ -447,16 +653,85 @@ if ($script:issuesFound.Count -gt 0) {
|
||||
Write-Host "║ ✓ Build Environment Ready for Development! ║" -ForegroundColor Green
|
||||
Write-Host "╚════════════════════════════════════════════════════════════════╝`n" -ForegroundColor Green
|
||||
|
||||
Write-Host "Next Steps:" -ForegroundColor Cyan
|
||||
Write-Host " Visual Studio (Recommended):" -ForegroundColor White
|
||||
Write-Host " 1. Open Visual Studio 2022." -ForegroundColor Gray
|
||||
Write-Host " 2. Select 'File -> Open -> Folder...' and choose the 'yaze' directory." -ForegroundColor Gray
|
||||
Write-Host " 3. Select a Windows preset (e.g., 'win-dbg') from the dropdown." -ForegroundColor Gray
|
||||
Write-Host " 4. Press F5 to build and debug.`n" -ForegroundColor Gray
|
||||
# Determine which IDE and preset to recommend
|
||||
$hasVS = Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
$hasVSCode = Test-Command "code"
|
||||
$hasNinja = Test-Command "ninja"
|
||||
|
||||
Write-Host " Command Line:" -ForegroundColor White
|
||||
Write-Host " cmake --preset win-dbg" -ForegroundColor Gray
|
||||
Write-Host " cmake --build --preset win-dbg`n" -ForegroundColor Gray
|
||||
Write-Host "Next Steps:" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# Recommend presets based on available tools
|
||||
if ($hasVS -and -not $hasNinja) {
|
||||
Write-Host " Recommended: Visual Studio Generator Presets" -ForegroundColor Yellow
|
||||
Write-Host " (Ninja not found - use win-vs-* presets)" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
} elseif ($hasNinja) {
|
||||
Write-Host " Recommended: Ninja Generator Presets (faster builds)" -ForegroundColor Yellow
|
||||
Write-Host " (Ninja detected - use win-* presets)" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Visual Studio instructions
|
||||
if ($hasVS) {
|
||||
Write-Host " Option 1: Visual Studio 2022 (Full IDE)" -ForegroundColor White
|
||||
Write-Host " 1. Open Visual Studio 2022" -ForegroundColor Gray
|
||||
Write-Host " 2. Select 'File -> Open -> Folder...' and choose the 'yaze' directory" -ForegroundColor Gray
|
||||
if ($hasNinja) {
|
||||
Write-Host " 3. Select preset: 'win-dbg' (Ninja) or 'win-vs-dbg' (VS Generator)" -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " 3. Select preset: 'win-vs-dbg' (install Ninja for win-dbg option)" -ForegroundColor Gray
|
||||
}
|
||||
Write-Host " 4. Press F5 to build and debug" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# VSCode instructions
|
||||
if ($hasVSCode) {
|
||||
Write-Host " Option 2: Visual Studio Code (Lightweight)" -ForegroundColor White
|
||||
Write-Host " 1. Open folder in VS Code: code ." -ForegroundColor Gray
|
||||
Write-Host " 2. Install CMake Tools extension (if not installed)" -ForegroundColor Gray
|
||||
if ($hasNinja) {
|
||||
Write-Host " 3. Select CMake preset: 'win-dbg' from status bar" -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " 3. Install Ninja first: choco install ninja" -ForegroundColor Gray
|
||||
Write-Host " Then select preset: 'win-dbg'" -ForegroundColor Gray
|
||||
}
|
||||
Write-Host " 4. Press F7 to build, F5 to debug" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Command line instructions
|
||||
Write-Host " Option 3: Command Line" -ForegroundColor White
|
||||
if ($hasNinja) {
|
||||
Write-Host " # Basic build (Ninja generator - fast)" -ForegroundColor Gray
|
||||
Write-Host " cmake --preset win-dbg" -ForegroundColor Cyan
|
||||
Write-Host " cmake --build --preset win-dbg" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host " # With AI features (gRPC + JSON)" -ForegroundColor Gray
|
||||
Write-Host " cmake --preset win-ai" -ForegroundColor Cyan
|
||||
Write-Host " cmake --build --preset win-ai" -ForegroundColor Cyan
|
||||
} else {
|
||||
Write-Host " # Visual Studio generator (install Ninja for faster builds)" -ForegroundColor Gray
|
||||
Write-Host " cmake --preset win-vs-dbg" -ForegroundColor Cyan
|
||||
Write-Host " cmake --build --preset win-vs-dbg" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host " # Install Ninja for faster builds:" -ForegroundColor Yellow
|
||||
Write-Host " choco install ninja" -ForegroundColor Gray
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# Available presets summary
|
||||
Write-Host " Available Presets:" -ForegroundColor White
|
||||
if ($hasNinja) {
|
||||
Write-Host " win-dbg - Debug build (Ninja)" -ForegroundColor Gray
|
||||
Write-Host " win-rel - Release build (Ninja)" -ForegroundColor Gray
|
||||
Write-Host " win-ai - Debug with AI/gRPC features (Ninja)" -ForegroundColor Gray
|
||||
}
|
||||
Write-Host " win-vs-dbg - Debug build (Visual Studio)" -ForegroundColor Gray
|
||||
Write-Host " win-vs-rel - Release build (Visual Studio)" -ForegroundColor Gray
|
||||
Write-Host " win-vs-ai - Debug with AI/gRPC features (Visual Studio)" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user