Fixes #31771
Summary
This PR resolves the incorrect reporting of ccache
usage for MSVC builds by:
- Removing forced compiler launcher configuration
- Improving status message accuracy
- Documenting proper MSVC+ccache workflows
Key Changes
- Deleted:
cmake/ccache.cmake
(Eliminates conflicts with user/CI configurations likesccache
) - Updated:
CMakeLists.txt
status reporting0if(CMAKE_CXX_COMPILER_LAUNCHER) 1 message(STATUS "Compiler launcher .............. ${CMAKE_CXX_COMPILER_LAUNCHER}") 2else() 3 message(STATUS "Use ccache for compiling .............. NO") 4endif()
- Added Documentation:
- Requires: Ninja generator
- Configure:
cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- Use:
/Z7
debug flags (not/Zi
)
Testing
0# MSVC 2022 + Ninja
1cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
2cmake --build build
3ccache -s # Verified cache hits
4
5# User override test
6cmake -B build -DCMAKE_CXX_COMPILER_LAUNCHER=sccache # No conflicts