Files
yaze/cmake/toolchains/windows-msvc.cmake
scawful ef07dc0012 chore: update configuration files and enhance dependency management
- Added new entries to `.pre-commit-config.yaml`, `cmake-format.yaml`, and `.github/dependabot.yml` to improve code quality checks and dependency updates.
- Enhanced GitHub Actions workflows by adding new steps for testing and build retention.
- Introduced support for the nlohmann_json library in CMake, allowing for conditional inclusion based on the `YAZE_ENABLE_JSON` option.
- Updated CMake configurations to streamline SDL2 and gRPC integration, ensuring proper linking and target management.

Benefits:
- Improves code quality and consistency through automated checks and formatting.
- Enhances dependency management and build reliability across platforms.
- Provides flexibility for users to enable optional features, improving overall functionality.
2025-10-31 20:20:31 -04:00

27 lines
756 B
CMake

# Windows MSVC Toolchain
# Optimized for Visual Studio 2022 with MSVC 19.30+
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# MSVC runtime library (static)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Compiler flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /permissive-")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Ob2 /DNDEBUG")
# Link flags
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
# Windows-specific definitions
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DNOMINMAX)