diff options
-rw-r--r-- | Modules/CMakeCUDACompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 13 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 3 |
4 files changed, 14 insertions, 6 deletions
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in index 1e34825..78606e6 100644 --- a/Modules/CMakeCUDACompiler.cmake.in +++ b/Modules/CMakeCUDACompiler.cmake.in @@ -1,5 +1,6 @@ set(CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@") set(CMAKE_CUDA_COMPILER_ID "@CMAKE_CUDA_COMPILER_ID@") +set(CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT "@CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_CUDA_COMPILER_ENV_VAR "CUDACXX") diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 9fcd8d7..ae51138 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -8,9 +8,10 @@ set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared) set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA -isystem=) set(CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY -Xcompiler=-fvisibility=) -if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 7.0) - set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") - set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11") - set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") - set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") -endif() + +set(CMAKE_CUDA98_STANDARD_COMPILE_OPTION "") +set(CMAKE_CUDA98_EXTENSION_COMPILE_OPTION "") +set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") +set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") + +set(CMAKE_CUDA_STANDARD_DEFAULT 98) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e7dfed5..1ccd489 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1472,6 +1472,9 @@ void cmLocalGenerator::AddCompilerRequirementFlag( langStdMap["C"].push_back("11"); langStdMap["C"].push_back("99"); langStdMap["C"].push_back("90"); + + langStdMap["CUDA"].push_back("11"); + langStdMap["CUDA"].push_back("98"); } std::string standard(standardProp); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 54bdfe6..48acc6e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -267,6 +267,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->SetPropertyDefault("CXX_STANDARD", CM_NULLPTR); this->SetPropertyDefault("CXX_STANDARD_REQUIRED", CM_NULLPTR); this->SetPropertyDefault("CXX_EXTENSIONS", CM_NULLPTR); + this->SetPropertyDefault("CUDA_STANDARD", CM_NULLPTR); + this->SetPropertyDefault("CUDA_STANDARD_REQUIRED", CM_NULLPTR); + this->SetPropertyDefault("CUDA_EXTENSIONS", CM_NULLPTR); this->SetPropertyDefault("LINK_SEARCH_START_STATIC", CM_NULLPTR); this->SetPropertyDefault("LINK_SEARCH_END_STATIC", CM_NULLPTR); } |