FindCUDA: CUDA_HOST_COMPILER has an invalid default value?

I am having build problems with LAMMPS that go back FindCUDA.cmake. FindCUDA.cmake selects CMAKE_C_COMPILER as the default value for the CUDA_HOST_COMPILER setting. As CUDA is a version of C++ (see https://docs.nvidia.com/cuda/pdf/CUDA_C_Programming_Guide.pdf sections 6.1, 6.1.5, and chapter 17) this choice is invalid (just like the nvcc error messages tell me). In fact if CUDAHOSTCXX is set then this value is used, clearly indicating that it is known that CUDA_HOST_COMPILER is supposed to be a C++ compiler and not a C compiler.

Would it not be better to set CUDA_HOST_COMPILER to CMAKE_CXX_COMPILER by default rather than choosing a default that breaks builds?

The FindCUDA module was deprecated long ago, and in fact was removed with a policy in CMake 3.27. Use CMake’s built-in CUDA support instead by adding CUDA as a language to enable in the first call to project(), or by calling enable_language().