summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/MSVC-C-FeatureTests.cmake4
-rw-r--r--Modules/Compiler/MSVC-C.cmake4
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake10
3 files changed, 11 insertions, 7 deletions
diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake
index 862bff3..4024c12 100644
--- a/Modules/Compiler/MSVC-C-FeatureTests.cmake
+++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake
@@ -1,9 +1,7 @@
set(_cmake_oldestSupported "_MSC_VER >= 1600")
-# Not yet supported:
-#set(_cmake_feature_test_c_static_assert "")
-
set(_cmake_feature_test_c_restrict "_MSC_VER >= 1927")
+set(_cmake_feature_test_c_static_assert "_MSC_VER >= 1928")
set(_cmake_feature_test_c_variadic_macros "${_cmake_oldestSupported}")
set(_cmake_feature_test_c_function_prototypes "${_cmake_oldestSupported}")
diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake
index a05e6a0..31ae7fd 100644
--- a/Modules/Compiler/MSVC-C.cmake
+++ b/Modules/Compiler/MSVC-C.cmake
@@ -51,6 +51,10 @@ macro(cmake_record_c_compile_features)
list(APPEND CMAKE_C_COMPILE_FEATURES c_restrict)
list(APPEND CMAKE_C99_COMPILE_FEATURES c_restrict)
endif()
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
+ list(APPEND CMAKE_C_COMPILE_FEATURES c_static_assert)
+ list(APPEND CMAKE_C11_COMPILE_FEATURES c_static_assert)
+ endif()
set(_result 0) # expected by cmake_determine_compile_features
endmacro()
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index feb5ecc..3187294 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -68,20 +68,22 @@ if(UNIX)
endif()
if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
+ # MSVC requires c++14 as the minimum level
set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "")
set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "")
+ # MSVC requires c++14 as the minimum level
set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "")
set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "")
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
- set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
- set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
endif()
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
- set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "")
- set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17")
endif()
else()