CUDA: I enabled c++20 in my project, now the configuration fails with `Target "XXX" requires the language dialect "CUDA20"` on MSVC
I have a project that used to build with C++17 without issues. It uses Cuda. I configure this with
set_target_properties(XXX PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS NO
CUDA_STANDARD 20
CUDA_ARCHITECTURES 50)
This used to work well when I used "17" instead of "20". Now with version "20" I get build errors on MSVC with the ClangCl compiler frontend:
-- Configuring done
CMake Error in CMakeLists.txt:
Target "XXX" requires the language dialect "CUDA20" , but CMake does
not know the compile flags to use to enable it.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
I'm not really sure what that means?
If cmake does not (yet) support CUDA_STANDARD=20
with MSVC or ClangCl, it would be great if the error message could be more helpful. I've googled for a while for the current error message and could not find anything remotely useful for CUDA. If this really is the problem, something like this would be better:
Target "XXX" wants to set the language dialect "CUDA_STANDARD" to "20".
But the current compiler "xxx" does not support this, or cmake does not
know the flags to enable it.
Edited by Brad King