CUDA: Work around VS limitation in CudaOnly.WithDefs test
CUDA 8.0 MSBuild rules do not pass `-x cu` to nvcc and so cannot support a custom file extension. Fix our test for this to use a `.cu` extension instead.
This commit is contained in:
parent
8cae24a1d0
commit
65481a60a0
@ -16,8 +16,15 @@ set(release_compile_defs DEFREL)
|
|||||||
#build a executable that needs to be passed a complex define through add_defintions
|
#build a executable that needs to be passed a complex define through add_defintions
|
||||||
#this verifies we can pass things such as '_','(' to nvcc
|
#this verifies we can pass things such as '_','(' to nvcc
|
||||||
add_definitions("-DPACKED_DEFINE=__attribute__((packed))")
|
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)
|
set_source_files_properties(main.notcu PROPERTIES LANGUAGE CUDA)
|
||||||
add_executable(CudaOnlyWithDefs main.notcu)
|
endif()
|
||||||
|
add_executable(CudaOnlyWithDefs ${main})
|
||||||
|
|
||||||
target_compile_options(CudaOnlyWithDefs
|
target_compile_options(CudaOnlyWithDefs
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
1
Tests/CudaOnly/WithDefs/main_for_vs.cu
Normal file
1
Tests/CudaOnly/WithDefs/main_for_vs.cu
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "main.notcu"
|
Loading…
Reference in New Issue
Block a user