Files
CMake/Tests/CudaOnly/utils/bin2c_wrapper.cmake
Robert Maynard 61b9764b03 CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATION
The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION`
now aren't mutually exclusive and can now be used together on the same
target.
2021-10-20 11:18:06 -04:00

20 lines
640 B
CMake

set(file_contents)
foreach(obj ${OBJECTS})
get_filename_component(obj_ext ${obj} EXT)
get_filename_component(obj_name ${obj} NAME_WE)
get_filename_component(obj_dir ${obj} DIRECTORY)
if(obj_ext MATCHES ".ptx")
set(args --name ${obj_name} ${obj})
execute_process(COMMAND "${BIN_TO_C_COMMAND}" ${args}
WORKING_DIRECTORY ${obj_dir}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error_var
)
set(file_contents "${file_contents} \n${output}")
endif()
endforeach()
file(WRITE "${OUTPUT}" "${file_contents}")