Commit Graph

5 Commits

Author SHA1 Message Date
scawful
cbdc6670a1 fix(windows): properly detect clang-cl and add /std:c++latest for std::filesystem
Root cause analysis:
- clang-cl on GitHub Actions Windows Server 2022 cannot find std::filesystem
- The compiler defaults to pre-C++17 compatibility, exposing only std::experimental::filesystem
- Build logs show: -std=c++23 (Unix-style flag) instead of /std:c++latest (MSVC-style flag)

Key insight: CMAKE_CXX_COMPILER_FRONTEND_VARIANT is needed to distinguish:
- "MSVC": clang-cl (Clang with MSVC command-line interface)
- "GNU": regular Clang on Windows

Solution:
1. Use CMAKE_CXX_COMPILER_FRONTEND_VARIANT to properly detect clang-cl
2. Add /std:c++latest flag specifically to yaze_util target (where filesystem is used)
3. Apply as PUBLIC compile option so it propagates to dependent targets

This targets the exact source of the problem - clang-cl needs MSVC-style /std:c++latest
flag to access modern MSVC STL features including std::filesystem.

Tested approach based on CMake 3.16+ feature CMAKE_CXX_COMPILER_FRONTEND_VARIANT.

Related commits: 19196ca87c, c2bb90a3f1, b556b155a5

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 02:15:00 -05:00
scawful
b556b155a5 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 <filesystem>

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 01:36:08 -05:00
scawful
e236ed93c3 refactor(ci): enhance caching and dependency management in workflows
- Added caching for ccache and CMake dependencies in CI and release workflows to improve build performance.
- Updated installation commands to include ccache across Linux, macOS, and Windows environments.
- Enhanced CMake configuration steps to utilize ccache for faster builds and added statistics reporting.

Benefits:
- Reduces build times and improves efficiency in CI processes, facilitating quicker feedback and integration.
2025-10-14 13:24:44 -04:00
scawful
73837a3c7f chore(cmake): update compiler flag settings in utils.cmake
- Modified the yaze_add_compiler_flags function to set C++ and C standards in the parent scope, ensuring they are applied correctly across the project.
- Added a new compiler flag for MSVC to support C++20/23 features, enhancing compatibility with modern C++ standards.

Benefits:
- Improved consistency in compiler settings across different CMake targets.
- Enhanced support for newer C++ features, facilitating modern development practices.
2025-10-11 11:13:23 -04:00
scawful
f54949bdd8 feat(build-system): enhance CMake configuration and introduce new utility files
- Refactored CMakeLists.txt to streamline project configuration and improve readability.
- Introduced new utility functions in `utils.cmake` for setting compiler flags and managing dependencies.
- Added `dependencies.cmake` to centralize third-party dependency management, enhancing modularity.
- Updated CI workflows to include new build options and improved logging for better feedback during configuration.
- Implemented precompiled headers in various libraries to speed up compilation times.

Benefits:
- Improved maintainability and clarity of the build system.
- Enhanced build performance through precompiled headers.
- Streamlined dependency management for easier integration of third-party libraries.
2025-10-11 02:44:17 -04:00