diff --git a/CMakeLists.txt b/CMakeLists.txt index d1c766c1..409a58bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,9 @@ option(YAZE_WITH_JSON "Enable JSON support for AI integrations" ON) # YAZE_WITH_GRPC: gRPC for GUI automation (auto-enables JSON) option(YAZE_WITH_GRPC "Enable gRPC-based ImGuiTestHarness for automated GUI testing (experimental)" OFF) +# YAZE_SUPPRESS_WARNINGS: Suppress compiler warnings for cleaner build output +option(YAZE_SUPPRESS_WARNINGS "Suppress compiler warnings (use -v preset suffix for verbose)" ON) + # Dependency resolution if(Z3ED_AI) message(STATUS "Z3ED_AI enabled: Activating AI agent dependencies (JSON, YAML, httplib)") @@ -107,6 +110,18 @@ set(YAZE_TEST_ROM_PATH "${CMAKE_BINARY_DIR}/bin/zelda3.sfc" CACHE STRING "Path t set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) + +# Apply warning suppression if requested +if(YAZE_SUPPRESS_WARNINGS) + if(MSVC) + add_compile_options(/w) + else() + add_compile_options(-w) + endif() + message(STATUS "✓ Warnings suppressed (use -v preset suffix for verbose builds)") +else() + message(STATUS "○ Verbose warnings enabled") +endif() set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/CMakePresets.json b/CMakePresets.json index 79916090..3fdc8e47 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -7,13 +7,13 @@ }, "configurePresets": [ { - "name": "default", - "displayName": "Default Config", - "description": "Default build configuration", + "name": "_base", + "hidden": true, + "description": "Base preset with common settings", "generator": "Unix Makefiles", "binaryDir": "${sourceDir}/build", "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "YAZE_BUILD_TESTS": "ON", "YAZE_BUILD_APP": "ON", "YAZE_BUILD_LIB": "ON", @@ -23,62 +23,118 @@ } }, { - "name": "debug", - "displayName": "Debug", - "description": "Debug build with full debugging symbols", - "inherits": "default", + "name": "_quiet", + "hidden": true, + "description": "Suppress warnings (default)", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS_DEBUG": "-g -O0 -DDEBUG", - "CMAKE_C_FLAGS_DEBUG": "-g -O0 -DDEBUG", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + "YAZE_SUPPRESS_WARNINGS": "ON" } }, { - "name": "release", - "displayName": "Release", - "description": "Optimized release build", - "inherits": "default", + "name": "_verbose", + "hidden": true, + "description": "Show all warnings and extra diagnostics", + "cacheVariables": { + "YAZE_SUPPRESS_WARNINGS": "OFF" + } + }, + { + "name": "_mac", + "hidden": true, + "description": "macOS base configuration", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "cacheVariables": { + "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0" + } + }, + { + "name": "_win", + "hidden": true, + "description": "Windows base configuration", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "generator": "Visual Studio 17 2022", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", + "VCPKG_MANIFEST_MODE": "ON" + } + }, + { + "name": "mac-dbg", + "displayName": "macOS Debug (ARM64)", + "description": "macOS ARM64 debug build (warnings off)", + "inherits": ["_base", "_mac", "_quiet"], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_OSX_ARCHITECTURES": "arm64" + } + }, + { + "name": "mac-dbg-v", + "displayName": "macOS Debug Verbose (ARM64)", + "description": "macOS ARM64 debug build with all warnings", + "inherits": ["_base", "_mac", "_verbose"], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_OSX_ARCHITECTURES": "arm64" + } + }, + { + "name": "mac-rel", + "displayName": "macOS Release (ARM64)", + "description": "macOS ARM64 release build (warnings off)", + "inherits": ["_base", "_mac", "_quiet"], "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_OSX_ARCHITECTURES": "arm64", "YAZE_BUILD_TESTS": "OFF" } }, { - "name": "dev", - "displayName": "Development", - "description": "Development build with ROM testing enabled", - "inherits": "debug", + "name": "mac-x64", + "displayName": "macOS Debug (x86_64)", + "description": "macOS x86_64 debug build (warnings off)", + "inherits": ["_base", "_mac", "_quiet"], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_OSX_ARCHITECTURES": "x86_64", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15" + } + }, + { + "name": "mac-uni", + "displayName": "macOS Universal", + "description": "macOS universal binary (ARM64 + x86_64)", + "inherits": ["_base", "_mac", "_quiet"], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15" + } + }, + { + "name": "mac-dev", + "displayName": "macOS Dev", + "description": "macOS development with ROM tests", + "inherits": "mac-dbg", "cacheVariables": { "YAZE_ENABLE_ROM_TESTS": "ON", "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc" } }, { - "name": "macos-dev", - "displayName": "macOS debug (ARM64)", - "description": "macOS ARM64 development build with ROM testing (no z3ed AI)", - "inherits": "macos-debug", + "name": "mac-ai", + "displayName": "macOS AI", + "description": "macOS with AI agent (z3ed + JSON + gRPC)", + "inherits": "mac-dev", "cacheVariables": { - "YAZE_BUILD_APP": "ON", - "YAZE_BUILD_EMU": "OFF", - "YAZE_BUILD_Z3ED": "OFF", - "YAZE_MINIMAL_BUILD": "ON", - "YAZE_BUILD_TESTS": "ON", - "YAZE_ENABLE_ROM_TESTS": "ON", - "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" - } - }, - { - "name": "macos-dev-z3ed-ai", - "displayName": "yaze-ai", - "description": "macOS ARM64 development build with ROM testing", - "binaryDir": "${sourceDir}/build_test", - "inherits": "macos-debug", - "cacheVariables": { - "YAZE_ENABLE_ROM_TESTS": "ON", - "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc", "Z3ED_AI": "ON", "YAZE_WITH_JSON": "ON", "YAZE_WITH_GRPC": "ON", @@ -87,304 +143,159 @@ } }, { - "name": "macos-agent-test", - "displayName": "z3ed-agent (ARM64)", - "description": "macOS ARM64 build for exercising the z3ed agent with JSON/GRPC", - "inherits": "macos-debug", + "name": "mac-z3ed", + "displayName": "macOS z3ed", + "description": "macOS z3ed CLI with agent support", + "inherits": "mac-ai" + }, + { + "name": "mac-rooms", + "displayName": "macOS Rooms", + "description": "macOS dungeon editor development", + "binaryDir": "${sourceDir}/build_rooms", + "inherits": "mac-dev", + "cacheVariables": { + "YAZE_BUILD_EMU": "OFF", + "YAZE_BUILD_Z3ED": "OFF", + "YAZE_MINIMAL_BUILD": "ON" + } + }, + { + "name": "win-dbg", + "displayName": "Windows Debug (x64)", + "description": "Windows x64 debug build (warnings off)", + "inherits": ["_base", "_win", "_quiet"], + "architecture": "x64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "VCPKG_TARGET_TRIPLET": "x64-windows" + } + }, + { + "name": "win-dbg-v", + "displayName": "Windows Debug Verbose (x64)", + "description": "Windows x64 debug build with all warnings", + "inherits": ["_base", "_win", "_verbose"], + "architecture": "x64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "VCPKG_TARGET_TRIPLET": "x64-windows" + } + }, + { + "name": "win-rel", + "displayName": "Windows Release (x64)", + "description": "Windows x64 release build (warnings off)", + "inherits": ["_base", "_win", "_quiet"], + "architecture": "x64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "VCPKG_TARGET_TRIPLET": "x64-windows", + "YAZE_BUILD_TESTS": "OFF" + } + }, + { + "name": "win-arm", + "displayName": "Windows ARM64 Debug", + "description": "Windows ARM64 debug build (warnings off)", + "inherits": ["_base", "_win", "_quiet"], + "architecture": "arm64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "VCPKG_TARGET_TRIPLET": "arm64-windows" + } + }, + { + "name": "win-arm-rel", + "displayName": "Windows ARM64 Release", + "description": "Windows ARM64 release build (warnings off)", + "inherits": ["_base", "_win", "_quiet"], + "architecture": "arm64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "VCPKG_TARGET_TRIPLET": "arm64-windows", + "YAZE_BUILD_TESTS": "OFF" + } + }, + { + "name": "win-dev", + "displayName": "Windows Dev", + "description": "Windows development with ROM tests", + "inherits": "win-dbg", "cacheVariables": { - "YAZE_WITH_JSON": "ON", - "YAZE_WITH_GRPC": "ON", - "YAZE_BUILD_Z3ED": "ON", - "YAZE_BUILD_TESTS": "ON", "YAZE_ENABLE_ROM_TESTS": "ON", "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc" } }, { - "name": "macos-dungeon-dev", - "displayName": "Dungeon Editor Dev (ARM64)", - "description": "macOS ARM64 build for dungeon editing implementation work (app + tests only)", - "binaryDir": "${sourceDir}/build_rooms", - "inherits": "macos-debug", + "name": "win-ai", + "displayName": "Windows AI", + "description": "Windows with AI agent (z3ed + JSON + gRPC)", + "inherits": "win-dev", "cacheVariables": { - "YAZE_BUILD_APP": "ON", - "YAZE_BUILD_EMU": "OFF", - "YAZE_BUILD_Z3ED": "OFF", - "YAZE_MINIMAL_BUILD": "ON", - "YAZE_BUILD_TESTS": "ON", - "YAZE_ENABLE_ROM_TESTS": "ON", - "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + "Z3ED_AI": "ON", + "YAZE_WITH_JSON": "ON", + "YAZE_WITH_GRPC": "ON", + "YAZE_BUILD_Z3ED": "ON", + "YAZE_BUILD_EMU": "ON" } }, { - "name": "ci", - "displayName": "Continuous Integration", - "description": "CI build without ROM-dependent tests", - "inherits": "default", - "cacheVariables": { - "YAZE_ENABLE_ROM_TESTS": "OFF", - "YAZE_BUILD_TESTS": "ON" - } + "name": "win-z3ed", + "displayName": "Windows z3ed", + "description": "Windows z3ed CLI with agent support", + "inherits": "win-ai" }, { - "name": "macos-debug", - "displayName": "macOS Debug (ARM64)", - "description": "macOS ARM64-specific debug configuration", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0", - "CMAKE_OSX_ARCHITECTURES": "arm64" - } - }, - { - "name": "macos-release", - "displayName": "macOS Release (ARM64)", - "description": "macOS ARM64-specific release configuration", - "inherits": "release", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0", - "CMAKE_OSX_ARCHITECTURES": "arm64" - } - }, - { - "name": "macos-debug-universal", - "displayName": "macOS Debug (Universal)", - "description": "macOS universal binary debug configuration", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", - "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" - } - }, - { - "name": "macos-release-universal", - "displayName": "macOS Release (Universal)", - "description": "macOS universal binary release configuration", - "inherits": "release", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", - "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" - } - }, - { - "name": "linux-debug", + "name": "lin-dbg", "displayName": "Linux Debug", - "description": "Linux-specific debug configuration", - "inherits": "debug", + "description": "Linux debug build with GCC (warnings off)", + "inherits": ["_base", "_quiet"], "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }, "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_COMPILER": "g++", "CMAKE_C_COMPILER": "gcc" } }, { - "name": "linux-clang", + "name": "lin-clang", "displayName": "Linux Clang", - "description": "Linux build with Clang", - "inherits": "debug", + "description": "Linux debug build with Clang (warnings off)", + "inherits": ["_base", "_quiet"], "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }, "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_COMPILER": "clang++", "CMAKE_C_COMPILER": "clang" } }, { - "name": "windows-debug", - "displayName": "Windows Debug", - "description": "Windows debug build (JSON enabled by default, AI features disabled)", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "x64", + "name": "ci", + "displayName": "CI", + "description": "Continuous integration build (no ROM tests)", + "inherits": ["_base", "_quiet"], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_MANIFEST_MODE": "ON" - } - }, - { - "name": "windows-release", - "displayName": "Windows Release", - "description": "Windows-specific release configuration with vcpkg", - "inherits": "release", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "x64", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_MANIFEST_MODE": "ON" - } - }, - { - "name": "windows-dev", - "displayName": "Windows Development", - "description": "Windows development build with vcpkg and testing enabled", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "x64", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "x64-windows", - "VCPKG_MANIFEST_MODE": "ON", - "YAZE_BUILD_TESTS": "ON", - "YAZE_ENABLE_ROM_TESTS": "ON" - } - }, - { - "name": "windows-agent-test", - "displayName": "Windows z3ed agent test", - "description": "Windows build for exercising the z3ed agent with JSON/GRPC", - "inherits": "windows-debug", - "cacheVariables": { - "YAZE_WITH_JSON": "ON", - "YAZE_WITH_GRPC": "ON", - "YAZE_BUILD_Z3ED": "ON", - "YAZE_BUILD_TESTS": "ON", - "YAZE_ENABLE_ROM_TESTS": "ON", - "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc" - } - }, - { - "name": "windows-ai-debug", - "displayName": "Windows AI Debug", - "description": "Windows debug build with AI agent features (JSON enabled)", - "inherits": "windows-debug", - "cacheVariables": { - "Z3ED_AI": "ON", - "YAZE_WITH_JSON": "ON", - "YAZE_BUILD_Z3ED": "ON", + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YAZE_ENABLE_ROM_TESTS": "OFF", "YAZE_BUILD_TESTS": "ON" } }, - { - "name": "windows-ai-release", - "displayName": "Windows AI Release", - "description": "Windows release build with AI agent features (JSON enabled)", - "inherits": "windows-release", - "cacheVariables": { - "Z3ED_AI": "ON", - "YAZE_WITH_JSON": "ON", - "YAZE_BUILD_Z3ED": "ON" - } - }, - { - "name": "windows-collab-debug", - "displayName": "Windows Collaboration Debug", - "description": "Windows debug build with full collaboration support (JSON + gRPC)", - "inherits": "windows-debug", - "cacheVariables": { - "Z3ED_AI": "ON", - "YAZE_WITH_JSON": "ON", - "YAZE_WITH_GRPC": "ON", - "YAZE_BUILD_Z3ED": "ON", - "YAZE_BUILD_TESTS": "ON" - } - }, - { - "name": "windows-arm64-debug", - "displayName": "Windows ARM64 Debug", - "description": "Windows ARM64-specific debug configuration with vcpkg", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "arm64", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "arm64-windows", - "VCPKG_MANIFEST_MODE": "ON" - } - }, - { - "name": "windows-arm64-release", - "displayName": "Windows ARM64 Release", - "description": "Windows ARM64-specific release configuration with vcpkg", - "inherits": "release", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "arm64", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "arm64-windows", - "VCPKG_MANIFEST_MODE": "ON" - } - }, - { - "name": "windows-arm64-dev", - "displayName": "Windows ARM64 Development", - "description": "Windows ARM64 development build with vcpkg and testing enabled", - "inherits": "debug", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "generator": "Visual Studio 17 2022", - "architecture": "arm64", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_TARGET_TRIPLET": "arm64-windows", - "VCPKG_MANIFEST_MODE": "ON", - "YAZE_BUILD_TESTS": "ON", - "YAZE_ENABLE_ROM_TESTS": "ON" - } - }, { "name": "asan", "displayName": "AddressSanitizer", "description": "Debug build with AddressSanitizer", - "inherits": "debug", + "inherits": "_base", "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer -g", "CMAKE_C_FLAGS": "-fsanitize=address -fno-omit-frame-pointer -g", "CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address", @@ -393,10 +304,11 @@ }, { "name": "coverage", - "displayName": "Code Coverage", + "displayName": "Coverage", "description": "Debug build with code coverage", - "inherits": "debug", + "inherits": "_base", "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_FLAGS": "--coverage -g -O0", "CMAKE_C_FLAGS": "--coverage -g -O0", "CMAKE_EXE_LINKER_FLAGS": "--coverage" @@ -405,39 +317,125 @@ ], "buildPresets": [ { - "name": "default", - "configurePreset": "default", - "displayName": "Default Build", + "name": "mac-dbg", + "configurePreset": "mac-dbg", + "displayName": "macOS Debug", "jobs": 12 }, { - "name": "debug", - "configurePreset": "debug", - "displayName": "Debug Build", + "name": "mac-dbg-v", + "configurePreset": "mac-dbg-v", + "displayName": "macOS Debug Verbose", "jobs": 12 }, { - "name": "release", - "configurePreset": "release", - "displayName": "Release Build", + "name": "mac-rel", + "configurePreset": "mac-rel", + "displayName": "macOS Release", "jobs": 12 }, { - "name": "dev", - "configurePreset": "dev", - "displayName": "Development Build", + "name": "mac-x64", + "configurePreset": "mac-x64", + "displayName": "macOS x86_64", "jobs": 12 }, { - "name": "macos-dev", - "configurePreset": "macos-dev", - "displayName": "macOS debug ARM64", + "name": "mac-uni", + "configurePreset": "mac-uni", + "displayName": "macOS Universal", "jobs": 12 }, { - "name": "macos-dev-z3ed-ai", - "configurePreset": "macos-dev-z3ed-ai", - "displayName": "yaze-ai", + "name": "mac-dev", + "configurePreset": "mac-dev", + "displayName": "macOS Dev", + "jobs": 12 + }, + { + "name": "mac-ai", + "configurePreset": "mac-ai", + "displayName": "macOS AI", + "jobs": 12 + }, + { + "name": "mac-z3ed", + "configurePreset": "mac-z3ed", + "displayName": "macOS z3ed", + "jobs": 12 + }, + { + "name": "mac-rooms", + "configurePreset": "mac-rooms", + "displayName": "macOS Rooms", + "jobs": 12 + }, + { + "name": "win-dbg", + "configurePreset": "win-dbg", + "displayName": "Windows Debug", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "win-dbg-v", + "configurePreset": "win-dbg-v", + "displayName": "Windows Debug Verbose", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "win-rel", + "configurePreset": "win-rel", + "displayName": "Windows Release", + "configuration": "Release", + "jobs": 12 + }, + { + "name": "win-arm", + "configurePreset": "win-arm", + "displayName": "Windows ARM64", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "win-arm-rel", + "configurePreset": "win-arm-rel", + "displayName": "Windows ARM64 Release", + "configuration": "Release", + "jobs": 12 + }, + { + "name": "win-dev", + "configurePreset": "win-dev", + "displayName": "Windows Dev", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "win-ai", + "configurePreset": "win-ai", + "displayName": "Windows AI", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "win-z3ed", + "configurePreset": "win-z3ed", + "displayName": "Windows z3ed", + "configuration": "Debug", + "jobs": 12 + }, + { + "name": "lin-dbg", + "configurePreset": "lin-dbg", + "displayName": "Linux Debug", + "jobs": 12 + }, + { + "name": "lin-clang", + "configurePreset": "lin-clang", + "displayName": "Linux Clang", "jobs": 12 }, { @@ -445,124 +443,12 @@ "configurePreset": "ci", "displayName": "CI Build", "jobs": 12 - }, - { - "name": "macos-debug", - "configurePreset": "macos-debug", - "displayName": "macOS Debug Build", - "jobs": 12 - }, - { - "name": "macos-release", - "configurePreset": "macos-release", - "displayName": "macOS Release Build (ARM64)", - "jobs": 12 - }, - { - "name": "macos-debug-universal", - "configurePreset": "macos-debug-universal", - "displayName": "macOS Debug Build (Universal)", - "jobs": 12 - }, - { - "name": "macos-release-universal", - "configurePreset": "macos-release-universal", - "displayName": "macOS Release Build (Universal)", - "jobs": 12 - }, - { - "name": "macos-agent-test", - "configurePreset": "macos-agent-test", - "displayName": "macOS z3ed Agent Test Build", - "jobs": 12 - }, - { - "name": "macos-dungeon-dev", - "configurePreset": "macos-dungeon-dev", - "displayName": "macOS Dungeon Editor Dev Build", - "jobs": 12 - }, - { - "name": "fast", - "configurePreset": "debug", - "displayName": "Fast Debug Build", - "jobs": 12 - }, - { - "name": "windows-debug", - "configurePreset": "windows-debug", - "displayName": "Windows Debug Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-release", - "configurePreset": "windows-release", - "displayName": "Windows Release Build", - "configuration": "Release", - "jobs": 12 - }, - { - "name": "windows-dev", - "configurePreset": "windows-dev", - "displayName": "Windows Development Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-arm64-debug", - "configurePreset": "windows-arm64-debug", - "displayName": "Windows ARM64 Debug Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-arm64-release", - "configurePreset": "windows-arm64-release", - "displayName": "Windows ARM64 Release Build", - "configuration": "Release", - "jobs": 12 - }, - { - "name": "windows-arm64-dev", - "configurePreset": "windows-arm64-dev", - "displayName": "Windows ARM64 Development Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-agent-test", - "configurePreset": "windows-agent-test", - "displayName": "Windows z3ed Agent Test Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-ai-debug", - "configurePreset": "windows-ai-debug", - "displayName": "Windows AI Debug Build", - "configuration": "Debug", - "jobs": 12 - }, - { - "name": "windows-ai-release", - "configurePreset": "windows-ai-release", - "displayName": "Windows AI Release Build", - "configuration": "Release", - "jobs": 12 - }, - { - "name": "windows-collab-debug", - "configurePreset": "windows-collab-debug", - "displayName": "Windows Collaboration Debug Build", - "configuration": "Debug", - "jobs": 12 } ], "testPresets": [ { "name": "stable", - "configurePreset": "default", + "configurePreset": "ci", "displayName": "Stable Tests (Release Ready)", "execution": { "noTestsAction": "error", @@ -576,7 +462,7 @@ }, { "name": "dev", - "configurePreset": "dev", + "configurePreset": "mac-dev", "displayName": "Development Tests (with ROM)", "execution": { "noTestsAction": "error", @@ -603,32 +489,8 @@ } }, { - "name": "experimental", - "configurePreset": "debug", - "displayName": "Experimental Tests", - "execution": { - "noTestsAction": "ignore", - "stopOnFailure": false - }, - "filter": { - "include": { - "name": ".*(E2ERomDependentTest|ZSCustomOverworldUpgradeTest).*" - } - } - }, - { - "name": "asar-only", - "configurePreset": "default", - "displayName": "Asar Tests Only", - "filter": { - "include": { - "name": ".*Asar.*" - } - } - }, - { - "name": "unit-only", - "configurePreset": "default", + "name": "unit", + "configurePreset": "ci", "displayName": "Unit Tests Only", "filter": { "exclude": { @@ -637,8 +499,8 @@ } }, { - "name": "integration-only", - "configurePreset": "default", + "name": "integration", + "configurePreset": "mac-dev", "displayName": "Integration Tests Only", "execution": { "noTestsAction": "error", @@ -649,79 +511,42 @@ "name": ".*(IntegrationTest|RomIntegrationTest|ComprehensiveIntegrationTest|OverworldIntegrationTest|DungeonIntegrationTest|DungeonEditorIntegrationTest|DungeonEditorSystemIntegrationTest|DungeonObjectRendererIntegrationTest|DungeonObjectRendererMockTest|DungeonObjectRenderingTests|Tile16EditorIntegrationTest).*" } } - }, - { - "name": "rom-only", - "configurePreset": "default", - "displayName": "ROM-Dependent Tests", - "execution": { - "noTestsAction": "error", - "stopOnFailure": false - }, - "filter": { - "include": { - "name": ".*(RomTest|RomIntegrationTest|ComprehensiveIntegrationTest|OverworldIntegrationTest|DungeonIntegrationTest|DungeonEditorIntegrationTest|DungeonEditorSystemIntegrationTest|DungeonObjectRendererIntegrationTest|DungeonObjectRendererMockTest|DungeonObjectRenderingTests|Tile16EditorIntegrationTest).*" - } - } - }, - { - "name": "e2e-only", - "configurePreset": "default", - "displayName": "End-to-End Tests", - "execution": { - "noTestsAction": "ignore", - "stopOnFailure": false - }, - "filter": { - "include": { - "name": ".*(E2ERomDependentTest|ZSCustomOverworldUpgradeTest).*" - } - } - }, - { - "name": "zscustom-overworld", - "configurePreset": "default", - "displayName": "ZS Custom Overworld Tests", - "execution": { - "noTestsAction": "ignore", - "stopOnFailure": false - }, - "filter": { - "include": { - "name": ".*ZSCustomOverworldUpgradeTest.*" - } - } } ], "packagePresets": [ { - "name": "default", - "configurePreset": "release", - "displayName": "Default Package" - }, - { - "name": "macos", - "configurePreset": "macos-release", + "name": "mac", + "configurePreset": "mac-rel", "displayName": "macOS Package (ARM64)" }, { - "name": "macos-universal", - "configurePreset": "macos-release-universal", + "name": "mac-uni", + "configurePreset": "mac-uni", "displayName": "macOS Package (Universal)" + }, + { + "name": "win", + "configurePreset": "win-rel", + "displayName": "Windows Package (x64)" + }, + { + "name": "win-arm", + "configurePreset": "win-arm-rel", + "displayName": "Windows Package (ARM64)" } ], "workflowPresets": [ { - "name": "dev-workflow", + "name": "dev", "displayName": "Development Workflow", "steps": [ { "type": "configure", - "name": "dev" + "name": "mac-dev" }, { "type": "build", - "name": "dev" + "name": "mac-dev" }, { "type": "test", @@ -730,7 +555,7 @@ ] }, { - "name": "ci-workflow", + "name": "ci", "displayName": "CI Workflow", "steps": [ { @@ -748,22 +573,22 @@ ] }, { - "name": "release-workflow", + "name": "release", "displayName": "Release Workflow", "steps": [ { "type": "configure", - "name": "macos-release" + "name": "mac-uni" }, { "type": "build", - "name": "macos-release" + "name": "mac-uni" }, { "type": "package", - "name": "macos" + "name": "mac-uni" } ] } ] -} +} \ No newline at end of file diff --git a/docs/CMAKE_PRESETS.md b/docs/CMAKE_PRESETS.md new file mode 100644 index 00000000..aafb4bf1 --- /dev/null +++ b/docs/CMAKE_PRESETS.md @@ -0,0 +1,207 @@ +# CMake Presets Quick Reference + +This document explains the reorganized CMake preset system for Yaze. + +## Design Principles + +1. **Short, memorable names** - No more `macos-dev-z3ed-ai`, just `mac-ai` +2. **Warnings off by default** - Add `-v` suffix for verbose (e.g., `mac-dbg-v`) +3. **Clear architecture support** - Explicit ARM64 and x86_64 presets +4. **Platform prefixes** - `mac-`, `win-`, `lin-` for easy identification + +## Quick Start + +### macOS Development +```bash +# Most common: AI-enabled development +cmake --preset mac-ai +cmake --build --preset mac-ai + +# Basic debug build (no AI) +cmake --preset mac-dbg +cmake --build --preset mac-dbg + +# Verbose warnings for debugging +cmake --preset mac-dbg-v +cmake --build --preset mac-dbg-v + +# Release build +cmake --preset mac-rel +cmake --build --preset mac-rel +``` + +### Windows Development +```bash +# Debug build (x64) +cmake --preset win-dbg +cmake --build --preset win-dbg + +# AI-enabled development +cmake --preset win-ai +cmake --build --preset win-ai + +# ARM64 support +cmake --preset win-arm +cmake --build --preset win-arm +``` + +## All Presets + +### macOS Presets + +| Preset | Description | Arch | Warnings | Features | +|--------|-------------|------|----------|----------| +| `mac-dbg` | Debug build | ARM64 | Off | Basic | +| `mac-dbg-v` | Debug verbose | ARM64 | On | Basic | +| `mac-rel` | Release | ARM64 | Off | Basic | +| `mac-x64` | Debug x86_64 | x86_64 | Off | Basic | +| `mac-uni` | Universal binary | Both | Off | Basic | +| `mac-dev` | Development | ARM64 | Off | ROM tests | +| `mac-ai` | AI development | ARM64 | Off | z3ed, JSON, gRPC, ROM tests | +| `mac-z3ed` | z3ed CLI | ARM64 | Off | AI agent support | +| `mac-rooms` | Dungeon editor | ARM64 | Off | Minimal build for room editing | + +### Windows Presets + +| Preset | Description | Arch | Warnings | Features | +|--------|-------------|------|----------|----------| +| `win-dbg` | Debug build | x64 | Off | Basic | +| `win-dbg-v` | Debug verbose | x64 | On | Basic | +| `win-rel` | Release | x64 | Off | Basic | +| `win-arm` | Debug ARM64 | ARM64 | Off | Basic | +| `win-arm-rel` | Release ARM64 | ARM64 | Off | Basic | +| `win-dev` | Development | x64 | Off | ROM tests | +| `win-ai` | AI development | x64 | Off | z3ed, JSON, gRPC, ROM tests | +| `win-z3ed` | z3ed CLI | x64 | Off | AI agent support | + +### Linux Presets + +| Preset | Description | Compiler | Warnings | +|--------|-------------|----------|----------| +| `lin-dbg` | Debug | GCC | Off | +| `lin-clang` | Debug | Clang | Off | + +### Special Purpose + +| Preset | Description | +|--------|-------------| +| `ci` | Continuous integration (no ROM tests) | +| `asan` | AddressSanitizer build | +| `coverage` | Code coverage build | + +## Warning Control + +By default, all presets suppress compiler warnings with `-w` for a cleaner build experience. + +### To Enable Verbose Warnings: + +1. Use a preset with `-v` suffix (e.g., `mac-dbg-v`, `win-dbg-v`) +2. Or set `YAZE_SUPPRESS_WARNINGS=OFF` manually: + ```bash + cmake --preset mac-dbg -DYAZE_SUPPRESS_WARNINGS=OFF + ``` + +## Architecture Support + +### macOS +- **ARM64 (Apple Silicon)**: `mac-dbg`, `mac-rel`, `mac-ai`, etc. +- **x86_64 (Intel)**: `mac-x64` +- **Universal Binary**: `mac-uni` (both ARM64 + x86_64) + +### Windows +- **x64**: `win-dbg`, `win-rel`, `win-ai`, etc. +- **ARM64**: `win-arm`, `win-arm-rel` + +## Build Directories + +Most presets use `build/` directory. Exceptions: +- `mac-rooms`: Uses `build_rooms/` to avoid conflicts + +## Feature Flags + +Common CMake options you can override: + +```bash +# Enable/disable components +-DYAZE_BUILD_TESTS=ON/OFF +-DYAZE_BUILD_Z3ED=ON/OFF +-DYAZE_BUILD_EMU=ON/OFF +-DYAZE_BUILD_APP=ON/OFF + +# AI features +-DZ3ED_AI=ON/OFF +-DYAZE_WITH_JSON=ON/OFF +-DYAZE_WITH_GRPC=ON/OFF + +# Testing +-DYAZE_ENABLE_ROM_TESTS=ON/OFF +-DYAZE_TEST_ROM_PATH=/path/to/zelda3.sfc + +# Build optimization +-DYAZE_MINIMAL_BUILD=ON/OFF +-DYAZE_USE_MODULAR_BUILD=ON/OFF +``` + +## Examples + +### Development with AI features and verbose warnings +```bash +cmake --preset mac-dbg-v -DZ3ED_AI=ON -DYAZE_WITH_GRPC=ON +cmake --build --preset mac-dbg-v +``` + +### Release build for distribution (macOS Universal) +```bash +cmake --preset mac-uni +cmake --build --preset mac-uni +cpack --preset mac-uni +``` + +### Quick minimal build for testing +```bash +cmake --preset mac-dbg -DYAZE_MINIMAL_BUILD=ON +cmake --build --preset mac-dbg -j12 +``` + +## Updating compile_commands.json + +After configuring with a new preset, copy the compile commands for IDE support: + +```bash +cp build/compile_commands.json . +``` + +This ensures clangd and other LSP servers can find headers and understand build flags. + +## Migration from Old Presets + +Old preset names have been simplified: + +| Old Name | New Name | +|----------|----------| +| `macos-dev-z3ed-ai` | `mac-ai` | +| `macos-debug` | `mac-dbg` | +| `macos-release` | `mac-rel` | +| `macos-debug-universal` | `mac-uni` | +| `macos-dungeon-dev` | `mac-rooms` | +| `windows-debug` | `win-dbg` | +| `windows-release` | `win-rel` | +| `windows-arm64-debug` | `win-arm` | +| `linux-debug` | `lin-dbg` | +| `linux-clang` | `lin-clang` | + +## Troubleshooting + +### Warnings are still showing +- Make sure you're using a preset without `-v` suffix +- Check `cmake` output for `✓ Warnings suppressed` message +- Reconfigure and rebuild: `rm -rf build && cmake --preset mac-dbg` + +### clangd can't find nlohmann/json +- Run `cmake --preset ` to regenerate compile_commands.json +- Copy to root: `cp build/compile_commands.json .` +- Restart your IDE or LSP server + +### Build fails with missing dependencies +- Ensure submodules are initialized: `git submodule update --init --recursive` +- For AI features, make sure you have OpenSSL: `brew install openssl` (macOS) diff --git a/src/app/gui/canvas/canvas.cmake b/src/app/gui/canvas/canvas.cmake index 4218f057..868811da 100644 --- a/src/app/gui/canvas/canvas.cmake +++ b/src/app/gui/canvas/canvas.cmake @@ -47,11 +47,13 @@ target_link_libraries(yaze_canvas PUBLIC SDL2::SDL2 ) -# Compiler-specific options -if(MSVC) - target_compile_options(yaze_canvas PRIVATE /W4) -else() - target_compile_options(yaze_canvas PRIVATE -Wall -Wextra -Wpedantic) +# Compiler-specific options (respect global warning settings) +if(NOT YAZE_SUPPRESS_WARNINGS) + if(MSVC) + target_compile_options(yaze_canvas PRIVATE /W4) + else() + target_compile_options(yaze_canvas PRIVATE -Wall -Wextra -Wpedantic) + endif() endif() # Add canvas to parent GUI library