Compile CUDA files as C++.
This commit is contained in:
parent
b2d6122769
commit
0f5692d1ea
@ -57,7 +57,7 @@ MARK_AS_ADVANCED (CUDA_FOUND CUDA_COMPILER CUDA_RUNTIME_LIBRARY)
|
||||
|
||||
|
||||
#SET(CUDA_OPTIONS "-ncfe")
|
||||
SET(CUDA_OPTIONS "")
|
||||
SET(CUDA_OPTIONS "--host-compilation=C++")
|
||||
|
||||
IF (CUDA_EMULATION)
|
||||
SET (CUDA_OPTIONS "${CUDA_OPTIONS} -deviceemu")
|
||||
@ -119,22 +119,22 @@ MACRO (WRAP_CUDA outfiles)
|
||||
|
||||
FOREACH (CUFILE ${ARGN})
|
||||
GET_FILENAME_COMPONENT (CUFILE ${CUFILE} ABSOLUTE)
|
||||
GET_FILENAME_COMPONENT (CFILE ${CUFILE} NAME_WE)
|
||||
SET (CFILE ${CMAKE_CURRENT_BINARY_DIR}/${CFILE}.gen.c)
|
||||
GET_FILENAME_COMPONENT (CPPFILE ${CUFILE} NAME_WE)
|
||||
SET (CPPFILE ${CMAKE_CURRENT_BINARY_DIR}/${CPPFILE}.gen.cpp)
|
||||
|
||||
GET_CUFILE_DEPENDENCIES(CUDEPS ${CUFILE})
|
||||
#MESSAGE("${CUDEPS}")
|
||||
|
||||
ADD_CUSTOM_COMMAND (
|
||||
OUTPUT ${CFILE}
|
||||
OUTPUT ${CPPFILE}
|
||||
COMMAND ${CUDA_COMPILER}
|
||||
ARGS -cuda ${cuda_includes} ${CUDA_OPTIONS} -o ${CFILE} ${CUFILE}
|
||||
ARGS -cuda ${cuda_includes} ${CUDA_OPTIONS} -o ${CPPFILE} ${CUFILE}
|
||||
MAIN_DEPENDENCY ${CUFILE}
|
||||
DEPENDS ${CUDEPS})
|
||||
|
||||
#MACRO_ADD_FILE_DEPENDENCIES(${CUFILE} ${CFILE})
|
||||
#MACRO_ADD_FILE_DEPENDENCIES(${CUFILE} ${CPPFILE})
|
||||
|
||||
SET (${outfiles} ${${outfiles}} ${CFILE})
|
||||
SET (${outfiles} ${${outfiles}} ${CPPFILE})
|
||||
ENDFOREACH (CUFILE)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${outfiles} PROPERTIES GENERATED 1)
|
||||
|
Loading…
Reference in New Issue
Block a user