build: fix MSVC ccache reporting
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 reportingif(CMAKE_CXX_COMPILER_LAUNCHER) message(STATUS "Compiler launcher .............. ${CMAKE_CXX_COMPILER_LAUNCHER}") else() message(STATUS "Use ccache for compiling .............. NO") endif()
-
Added Documentation:
- Requires: Ninja generator
-
Configure:
cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-
Use:
/Z7
debug flags (not/Zi
)
Testing
# MSVC 2022 + Ninja
cmake -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build
ccache -s # Verified cache hits
# User override test
cmake -B build -DCMAKE_CXX_COMPILER_LAUNCHER=sccache # No conflicts