Skip to content

Commit

Permalink
Fix inline_local_includes (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
csbnw committed Jul 4, 2024
1 parent 13b7023 commit eac68a6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cmake/cudawrappers-helper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ function(inline_local_includes input_file output_file)
foreach(include ${includes})
string(REGEX REPLACE ${include_regex} "\\1" include ${include})
file(GLOB_RECURSE INCLUDE_PATHS "${PROJECT_SOURCE_DIR}/*/${include}")
if(INCLUDE_PATHS STREQUAL "")
return()
if(NOT INCLUDE_PATHS STREQUAL "")
list(SORT INCLUDE_PATHS ORDER DESCENDING)
list(GET INCLUDE_PATHS 0 include_PATH)
list(APPEND include_files ${include_PATH})
file(READ ${include_PATH} include_contents)
string(APPEND processed_file_contents "${include_contents}\n\n")
endif()
list(SORT INCLUDE_PATHS ORDER DESCENDING)
list(GET INCLUDE_PATHS 0 include_PATH)
list(APPEND include_files ${include_PATH})
file(READ ${include_PATH} include_contents)
string(APPEND processed_file_contents "${include_contents}\n\n")
endforeach()
string(APPEND processed_file_contents "${input_file_contents}\n")
file(WRITE ${output_file} "${processed_file_contents}")
Expand Down

0 comments on commit eac68a6

Please sign in to comment.