summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-09-24 19:31:55 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-08 12:30:59 (GMT)
commitda2622ff366e6089a98109c68ececac58d598b66 (patch)
tree8205c6455c1c996ccb39d6270b8de385a92e78bb /Modules
parentc61f820a7fb1b191fe5591805f7e53fc52424f93 (diff)
downloadCMake-da2622ff366e6089a98109c68ececac58d598b66.zip
CMake-da2622ff366e6089a98109c68ececac58d598b66.tar.gz
CMake-da2622ff366e6089a98109c68ececac58d598b66.tar.bz2
CUDA: Add Support to SourceCompiles|Runs and CheckCompilerFlags
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckCompilerFlag.cmake4
-rw-r--r--Modules/CheckSourceCompiles.cmake3
-rw-r--r--Modules/CheckSourceRuns.cmake3
3 files changed, 10 insertions, 0 deletions
diff --git a/Modules/CheckCompilerFlag.cmake b/Modules/CheckCompilerFlag.cmake
index f2385d5..3ce1b9b 100644
--- a/Modules/CheckCompilerFlag.cmake
+++ b/Modules/CheckCompilerFlag.cmake
@@ -49,6 +49,10 @@ function(CHECK_COMPILER_FLAG _lang _flag _var)
elseif(_lang STREQUAL CXX)
set(_lang_src "int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_src "__host__ int main() { return 0; }")
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
+ FAIL_REGEX "argument unused during compilation: .*") # Clang
elseif(_lang STREQUAL Fortran)
set(_lang_src " program test\n stop\n end program")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
diff --git a/Modules/CheckSourceCompiles.cmake b/Modules/CheckSourceCompiles.cmake
index 70a733d..08fc153 100644
--- a/Modules/CheckSourceCompiles.cmake
+++ b/Modules/CheckSourceCompiles.cmake
@@ -89,6 +89,9 @@ function(CHECK_SOURCE_COMPILES _lang _source _var)
elseif(_lang STREQUAL CXX)
set(_lang_textual "C++")
set(_lang_ext "cxx")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_textual "CUDA")
+ set(_lang_ext "cu")
elseif(_lang STREQUAL Fortran)
set(_lang_textual "Fortran")
set(_lang_ext "F")
diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake
index 6165123..20f3e1e 100644
--- a/Modules/CheckSourceRuns.cmake
+++ b/Modules/CheckSourceRuns.cmake
@@ -87,6 +87,9 @@ function(CHECK_SOURCE_RUNS _lang _source _var)
elseif(_lang STREQUAL CXX)
set(_lang_textual "C++")
set(_lang_ext "cxx")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_textual "CUDA")
+ set(_lang_ext "cu")
elseif(_lang STREQUAL Fortran)
set(_lang_textual "Fortran")
set(_lang_ext "F")