summaryrefslogtreecommitdiffstats
path: root/Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake')
-rw-r--r--Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake b/Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake
new file mode 100644
index 0000000..dee7580
--- /dev/null
+++ b/Modules/Internal/CMakeNVCCFilterImplicitInfo.cmake
@@ -0,0 +1,16 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+macro(cmake_nvcc_filter_implicit_info lang lang_var_)
+ # 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(${lang_var_}TOOLKIT_INCLUDE_DIRECTORIES)
+ list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES
+ ${${lang_var_}TOOLKIT_INCLUDE_DIRECTORIES}
+ )
+ endif()
+endmacro()