Skip to content

Commit

Permalink
null sinks differ on different platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
kgizdov authored and lmoneta committed Aug 12, 2020
1 parent d250ee2 commit 220aaa2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmake/modules/RootConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,17 @@ if(found_stdstringview)
set(hasstdstringview define)
if(cuda)
if(CUDA_NVCC_EXECUTABLE)
if (WIN32)
set(PLATFORM_NULL_FILE "nul")
else()
set(PLATFORM_NULL_FILE "/dev/null")
endif()
execute_process(
COMMAND "echo"
"-e" "#include <string_view>\nint main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}"
COMMAND "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "/dev/null" "-x" "c++" "-"
COMMAND "${CUDA_NVCC_EXECUTABLE}" "-std=c++${CMAKE_CUDA_STANDARD}" "-o" "${PLATFORM_NULL_FILE}" "-x" "c++" "-"
RESULT_VARIABLE nvcc_compiled_string_view)
unset(PLATFORM_NULL_FILE CACHE)
if (nvcc_compiled_string_view EQUAL "0")
set(cudahasstdstringview define)
endif()
Expand Down

0 comments on commit 220aaa2

Please sign in to comment.