CUDA/nvcc: List the CUDA compiler's fallback for C++ host-side code
When using NVCC, an independent C++ compiler is used for host-side C++ code compilation (which does not have to be CMAKE_CXX_COMPILER). Other CUDA compilers (specifically, LLVM) may be able to serve as "their own fallback". In both cases, and particularly in the case of NVCC, CMake's detection should explicitly print which fallback compiler will be used, e.g. instead of, say:
-- The CUDA compiler identification is NVIDIA 11.6.55
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
etc.
we would see something like:
-- The CUDA compiler identification is NVIDIA 11.6.55
-- The CUDA host-side C++ fallback compiler identification is GNU 10.2.1
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
etc.
This issue is related to #23198 (closed).
Edited by Brad King