summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-04 13:29:48 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-04 13:30:12 (GMT)
commit28013c9434b748c5009061844f19b29f0d482c9e (patch)
treea8b5c44c7616c067979271b7c389e81848187161 /Modules
parent37af0fac54878414c1d9c1d1b0c286c21a82d8d4 (diff)
parent87df63707859d69a91764b4d491aaec7bec8d312 (diff)
downloadCMake-28013c9434b748c5009061844f19b29f0d482c9e.zip
CMake-28013c9434b748c5009061844f19b29f0d482c9e.tar.gz
CMake-28013c9434b748c5009061844f19b29f0d482c9e.tar.bz2
Merge topic 'cuda_remove_toolkit_dirs_from_implicit_includes'
87df637078 CUDA: Do not treat CUDA toolkit include directories as implicit Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4317
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index d80b55a..05811a8 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -78,6 +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}
+ )
+ endif()
+
# Re-configure to save learned information.
configure_file(
${CMAKE_ROOT}/Modules/CMakeCUDACompiler.cmake.in