Skip to content

Commit

Permalink
Simplify logic on where patch error messages go
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Oct 10, 2024
1 parent f4a5f49 commit 88e52db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rapids-cmake/cpm/patches/command_template.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ function(rapids_cpm_run_git_patch file issue require)
)
endif()

# Setup where we log error message too
set(error_msg_var msg_state)
if(require)
set(error_msg_var error_state)
endif()

if(result EQUAL 0)
list(APPEND msg_state "rapids-cmake [@package_name@]: applied ${ext} ${file_name} to fix issue: '${issue}'\n")
elseif(require)
list(APPEND error_state "rapids-cmake [@package_name@]: failed to apply ${ext} ${file_name} \n")
list(APPEND error_state "rapids-cmake [@package_name@]: git ${ext} output: ${repo_error_info} \n")
else()
list(APPEND msg_state "rapids-cmake [@package_name@]: failed to apply ${ext} ${file_name}\n")
list(APPEND msg_state "rapids-cmake [@package_name@]: git ${ext} output: ${repo_error_info}\n")
list(APPEND ${error_msg_var} "rapids-cmake [@package_name@]: failed to apply ${ext} ${file_name}\n")
list(APPEND ${error_msg_var} "rapids-cmake [@package_name@]: git ${ext} output: ${repo_error_info}\n")
endif()
set(msg_state ${msg_state} PARENT_SCOPE)
set(error_state ${error_state} PARENT_SCOPE)
Expand Down

0 comments on commit 88e52db

Please sign in to comment.