From 138436609fbc1d4dd9f0cac8c1a5ed3e53446091 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Apr 2024 15:09:58 -0400 Subject: CUDA: Fix detection of default C++ standard level with MSVC host compiler --- Modules/CMakeCUDACompilerId.cu.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeCUDACompilerId.cu.in b/Modules/CMakeCUDACompilerId.cu.in index be8f1b3..cecb948 100644 --- a/Modules/CMakeCUDACompilerId.cu.in +++ b/Modules/CMakeCUDACompilerId.cu.in @@ -22,7 +22,15 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; #define CXX_STD_20 202002L #define CXX_STD_23 202302L -#define CXX_STD __cplusplus +#if defined(_MSC_VER) && defined(_MSVC_LANG) +# if _MSVC_LANG > __cplusplus +# define CXX_STD _MSVC_LANG +# else +# define CXX_STD __cplusplus +# endif +#else +# define CXX_STD __cplusplus +#endif const char* info_language_standard_default = "INFO" ":" "standard_default[" #if CXX_STD > CXX_STD_23 -- cgit v0.12