Skip to content

Commit

Permalink
restore comments & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lightmanLP committed Feb 3, 2025
1 parent 1650d42 commit 706c26b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/dependencies/git-patch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function(check_patch)
set(ret ${ret} PARENT_SCOPE)
endfunction()

# Applies the patch or checks if it has already been applied successfully previously. Will error otherwise.
function(patch_if_needed)
patch()
if(NOT ret EQUAL 0)
Expand All @@ -26,6 +27,7 @@ function(patch_if_needed)
set(ret ${ret} PARENT_SCOPE)
endfunction()

# Resets code and reapply patch, if old (potentially incompatible) patch applied
function(patch_if_needed_with_reset)
patch_if_needed()
if(NOT ret EQUAL 0)
Expand All @@ -46,12 +48,12 @@ function(patch_if_needed_with_reset)
endfunction()

message(STATUS "Trying to apply patch ${patch_file}")
message(STATUS "${CMAKE_CURRENT_LIST_DIR}")
if(with_reset)
patch_if_needed_with_reset()
else()
patch_if_needed()
endif()

if(NOT ret EQUAL 0)
message(FATAL_ERROR "Failed to apply patch ${patch_file}")
else()
Expand Down

0 comments on commit 706c26b

Please sign in to comment.