summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCUDACompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeTestCUDACompiler.cmake')
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake22
1 files changed, 12 insertions, 10 deletions
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index 05811a8..5ad7257 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -78,16 +78,18 @@ else()
list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES cudart cudart_static cudadevrt)
list(REMOVE_ITEM CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES cudart cudart_static cudadevrt)
- # Remove the CUDA Toolkit include directories from the set of
- # implicit system include directories.
- # This resolves the issue that NVCC doesn't specify these
- # includes as SYSTEM includes when compiling device code, and sometimes
- # they contain headers that generate warnings, so let users mark them
- # as SYSTEM explicitly
- if(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES)
- list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
- ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
- )
+ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ # Remove the CUDA Toolkit include directories from the set of
+ # implicit system include directories.
+ # This resolves the issue that NVCC doesn't specify these
+ # includes as SYSTEM includes when compiling device code, and sometimes
+ # they contain headers that generate warnings, so let users mark them
+ # as SYSTEM explicitly
+ if(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES)
+ list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
+ ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
+ )
+ endif()
endif()
# Re-configure to save learned information.