diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index 8c83585ba..aca61fe25 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -14,7 +14,8 @@ set(imgui_fixes_and_config_patch_file ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependen # Applies the patch or checks if it has already been applied successfully previously. Will error otherwise. set(imgui_apply_patch_if_needed git apply ${imgui_fixes_and_config_patch_file} ${git_hide_output} || git apply --reverse --check ${imgui_fixes_and_config_patch_file}) # Resets code and reapply patch, if old (potentially incompatible) patch applied -set(imgui_apply_patch_if_needed_with_reset ${imgui_apply_patch_if_needed} || git diff --check && (git reset --hard || ${imgui_apply_patch_if_needed})) +set(imgui_apply_patch_if_needed_with_reset ${imgui_apply_patch_if_needed} || (git status --porcelain && git reset --hard && (${imgui_apply_patch_if_needed}))) + FetchContent_Declare( ImGui GIT_REPOSITORY https://github.com/ocornut/imgui.git @@ -51,7 +52,7 @@ if(NOT EXCLUDE_MPQ_SUPPORT) # Applies the patch or checks if it has already been applied successfully previously. Will error otherwise. set(stormlib_apply_patch_if_needed git apply ${stormlib_patch_file} ${git_hide_output} || git apply --reverse --check ${stormlib_patch_file}) # Resets code and reapply patch, if old (potentially incompatible) patch applied - set(stormlib_apply_patch_if_needed_with_reset ${stormlib_apply_patch_if_needed} || git diff --check && (git reset --hard || ${stormlib_apply_patch_if_needed})) + set(stormlib_apply_patch_if_needed_with_reset ${stormlib_apply_patch_if_needed} || (git status --porcelain && git reset --hard && (${stormlib_apply_patch_if_needed}))) FetchContent_Declare( StormLib