|
|
@@ -29,6 +29,14 @@ macro(cmake_nvcc_parse_implicit_info lang lang_var_)
|
|
|
string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}")
|
|
|
string(APPEND _nvcc_log " no 'INCLUDES=' string found in nvcc output:${_nvcc_output_log}\n")
|
|
|
endif()
|
|
|
+ if(_nvcc_output_orig MATCHES "#\\\$ +SYSTEM_INCLUDES= *([^\n]*)\n")
|
|
|
+ set(_nvcc_system_includes "${CMAKE_MATCH_1}")
|
|
|
+ string(APPEND _nvcc_log " found 'SYSTEM_INCLUDES=' string: [${_nvcc_system_includes}]\n")
|
|
|
+ else()
|
|
|
+ set(_nvcc_system_includes "")
|
|
|
+ string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}")
|
|
|
+ string(APPEND _nvcc_log " no 'SYSTEM_INCLUDES=' string found in nvcc output:${_nvcc_output_log}\n")
|
|
|
+ endif()
|
|
|
string(REGEX MATCHALL "-arch compute_([0-9]+)" _nvcc_target_cpus "${_nvcc_output_orig}")
|
|
|
foreach(_nvcc_target_cpu ${_nvcc_target_cpus})
|
|
|
if(_nvcc_target_cpu MATCHES "-arch compute_([0-9]+)")
|
|
|
@@ -134,7 +142,7 @@ macro(cmake_nvcc_parse_implicit_info lang lang_var_)
|
|
|
endif()
|
|
|
|
|
|
set(${lang_var_}TOOLKIT_INCLUDE_DIRECTORIES)
|
|
|
- if(_nvcc_includes)
|
|
|
+ if(_nvcc_includes OR _nvcc_system_includes)
|
|
|
# across all operating system each include directory is prefixed with -I
|
|
|
separate_arguments(_nvcc_output NATIVE_COMMAND "${_nvcc_includes}")
|
|
|
foreach(line IN LISTS _nvcc_output)
|
|
|
@@ -143,6 +151,17 @@ macro(cmake_nvcc_parse_implicit_info lang lang_var_)
|
|
|
list(APPEND ${lang_var_}TOOLKIT_INCLUDE_DIRECTORIES "${line}")
|
|
|
endforeach()
|
|
|
|
|
|
+ # across all operating system each system include directory is prefixed with -isystem
|
|
|
+ unset(_nvcc_output)
|
|
|
+ separate_arguments(_nvcc_output NATIVE_COMMAND "${_nvcc_system_includes}")
|
|
|
+ foreach(line IN LISTS _nvcc_output)
|
|
|
+ string(REGEX REPLACE "^-isystem" "" line "${line}")
|
|
|
+ if(line)
|
|
|
+ get_filename_component(line "${line}" ABSOLUTE)
|
|
|
+ list(APPEND ${lang_var_}TOOLKIT_INCLUDE_DIRECTORIES "${line}")
|
|
|
+ endif()
|
|
|
+ endforeach()
|
|
|
+
|
|
|
message(CONFIGURE_LOG
|
|
|
"Parsed CUDA nvcc include information:\n${_nvcc_log}\n${log}\n\n")
|
|
|
else()
|