summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-01-11 22:15:31 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2018-01-12 20:17:03 (GMT)
commit46abfedb8395f7e72281bd8eb7bd4f118c311140 (patch)
tree703899604007d87b1ad5e842276cc2aca06ea401 /Tests/CudaOnly
parent46ad7215979cd60c00589f6f0abdcff2856069e8 (diff)
downloadCMake-46abfedb8395f7e72281bd8eb7bd4f118c311140.zip
CMake-46abfedb8395f7e72281bd8eb7bd4f118c311140.tar.gz
CMake-46abfedb8395f7e72281bd8eb7bd4f118c311140.tar.bz2
CUDA: MSVC will now state files are cuda files when needed
The MSVC CUDA build customizations before CUDA 9 would not explicitly add the -x cu option when building. This caused .cpp and .c files invoked with CudaCompile to be compiled as host code and not cuda. Now when we detect CUDA < 9 we will explicitly add this option to correct this bug.
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt10
-rw-r--r--Tests/CudaOnly/WithDefs/main_for_vs.cu1
2 files changed, 2 insertions, 9 deletions
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 5bd93a4..308c089 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -21,14 +21,8 @@ set(release_compile_defs DEFREL)
#this verifies we can pass things such as '_','(' to nvcc
add_definitions("-DPACKED_DEFINE=__attribute__((packed))")
-if(CMAKE_GENERATOR MATCHES "Visual Studio")
- # CUDA MSBuild rules do not pass '-x cu' to nvcc
- set(main main_for_vs.cu)
-else()
- set(main main.notcu)
- set_source_files_properties(main.notcu PROPERTIES LANGUAGE CUDA)
-endif()
-add_executable(CudaOnlyWithDefs ${main})
+add_executable(CudaOnlyWithDefs main.notcu)
+set_source_files_properties(main.notcu PROPERTIES LANGUAGE CUDA)
target_compile_options(CudaOnlyWithDefs
PRIVATE
diff --git a/Tests/CudaOnly/WithDefs/main_for_vs.cu b/Tests/CudaOnly/WithDefs/main_for_vs.cu
deleted file mode 100644
index 56078e7..0000000
--- a/Tests/CudaOnly/WithDefs/main_for_vs.cu
+++ /dev/null
@@ -1 +0,0 @@
-#include "main.notcu"