From b556b155a5e7f8ab2c0574baa5ca012e1cbd0f1d Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 20 Nov 2025 01:36:08 -0500 Subject: [PATCH] fix(windows): add /std:c++latest flag for clang-cl to enable std::filesystem Root cause: clang-cl on Windows Server 2022 with MSVC STL cannot find std::filesystem without explicit C++ standard flag. The compiler defaults to an older compatibility mode that only exposes std::experimental::filesystem. Solution: Add /std:c++latest compiler flag specifically for clang-cl builds on Windows. This enables proper C++23 standard library support including std::filesystem from MSVC STL. The fix is applied via yaze_common interface target in cmake/utils.cmake, ensuring all targets using yaze_common get the correct flags. This has blocked Windows releases for 2+ weeks. Fixes compilation errors in: - src/util/platform_paths.h - src/util/platform_paths.cc - src/util/file_util.cc - All other files using Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cmake/utils.cmake | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index f50baa44..ff320346 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -40,12 +40,28 @@ function(yaze_add_compiler_flags) # Compiler-specific settings if(MSVC) - target_compile_options(yaze_common INTERFACE - /EHsc - /W4 /permissive- - /bigobj - /utf-8 - ) + # Check if we're using clang-cl (Clang with MSVC-compatible command line) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # clang-cl requires explicit /std:c++latest to access C++23 features including + # Without this, clang-cl only sees std::experimental::filesystem from older MSVC STL + target_compile_options(yaze_common INTERFACE + /EHsc + /W4 /permissive- + /bigobj + /utf-8 + /std:c++latest + ) + message(STATUS "Windows clang-cl: Added /std:c++latest for C++23 and std::filesystem support") + else() + # Regular MSVC compiler + target_compile_options(yaze_common INTERFACE + /EHsc + /W4 /permissive- + /bigobj + /utf-8 + ) + endif() + target_compile_definitions(yaze_common INTERFACE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS