Browse Source

Merge topic 'cuda_9_support'

fe37b994 CUDA: Add support for requesting C++98 under CUDA 9

Acked-by: Kitware Robot <[email protected]>
Merge-request: !1315
Brad King 8 years ago
parent
commit
6bced4bf76
2 changed files with 3 additions and 1 deletions
  1. 1 1
      Help/prop_tgt/CUDA_STANDARD.rst
  2. 2 0
      Modules/Compiler/NVIDIA-CUDA.cmake

+ 1 - 1
Help/prop_tgt/CUDA_STANDARD.rst

@@ -7,7 +7,7 @@ This property specifies the CUDA/C++ standard whose features are requested
 to build this target.  For some compilers, this results in adding a
 flag such as ``-std=gnu++11`` to the compile line.
 
-Supported values are ``98``, ``11``.
+Supported values are ``98``, ``11``, ``14``.
 
 If the value requested does not result in a compile flag being added for
 the compiler in use, a previous standard flag will be added instead.  This

+ 2 - 0
Modules/Compiler/NVIDIA-CUDA.cmake

@@ -26,6 +26,8 @@ else()
   set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11")
 
   if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
+    set(CMAKE_CUDA98_STANDARD_COMPILE_OPTION "-std=c++03")
+    set(CMAKE_CUDA98_EXTENSION_COMPILE_OPTION "-std=c++03")
     set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
     set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
   endif()