From 036ffe815acd1ea4ee5cafb1b9547930bfbdbebf Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 11 May 2017 13:33:10 -0400 Subject: CUDA: Add support for the C++14 standard flag. CUDA 9 toolkit has announced support for C++14 flag, so lets allow users to use it. --- Modules/Compiler/NVIDIA-CUDA.cmake | 6 ++++++ Source/cmLocalGenerator.cxx | 1 + 2 files changed, 7 insertions(+) diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 316cab8..785e269 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -24,4 +24,10 @@ else() set(CMAKE_CUDA98_EXTENSION_COMPILE_OPTION "") set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") + + if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) + set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") + set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") + endif() + endif() diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0ab6e89..d51217c 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1518,6 +1518,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( langStdMap["C"].push_back("99"); langStdMap["C"].push_back("90"); + langStdMap["CUDA"].push_back("14"); langStdMap["CUDA"].push_back("11"); langStdMap["CUDA"].push_back("98"); } -- cgit v0.12