Should use the CMake file API to get toolchain details, not assume things are in CMakeCache.txt
Brief Issue Summary
#2121 describes the problem, but it was closed without actually identifying and fixing the underlying issue. The extension is assuming that CMAKE_C_COMPILER and CMAKE_CXX_COMPILER are set as cache variables, but this isn't always the case. A toolchain file can (and generally should) set these as regular non-cache variables. When it does so, same-named cache variables won't be created and the extension fails to start debugging due to them being missing.
The appropriate place for the extension to get reliable information about the toolchain is to use the CMake file API. It can use a query for the "Toolchains" object kind, which includes the path to the selected compiler.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
@craigscott-crascit Thanks for the issue and the information, we will investigate this. Thanks!
Seems I reported this same problem twice 18 months apart. At least I was consistent I guess? You probably want to close this one as a duplicate of #3027, or vice versa.
@craigscott-crascit Thank you for your reminder. We have duplicated issue #3027 to this issue. Thank you.