Skip to content

Commit 68f866a

Browse files
authored
Exit CMake processing when apply_patches failed (#304)
* Exit CMake processing when apply_patches failed Signed-off-by: haonanya <[email protected]> * Apply suggestions Signed-off-by: haonanya <[email protected]> * Skip the rest when apply patch failed Signed-off-by: haonanya <[email protected]>
1 parent 8de9a5d commit 68f866a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/modules/CMakeFunctions.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
146146
WORKING_DIRECTORY ${repo_dir}
147147
OUTPUT_VARIABLE patching_log
148148
ERROR_QUIET
149+
RESULT_VARIABLE ret_apply_patch
149150
)
150151
message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}")
152+
if (ret_apply_patch)
153+
break()
154+
endif()
151155
endif()
152156
endforeach(patch)
153157
else() # The target branch already exists
@@ -161,6 +165,8 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
161165
endif()
162166
if (NOT (ret_not_git_repo OR ret_check_out OR ret_apply_patch))
163167
set(${ret} True PARENT_SCOPE)
168+
else()
169+
message(FATAL_ERROR "[OPENCL-CLANG] Failed to apply patch!")
164170
endif()
165171
endfunction()
166172

0 commit comments

Comments
 (0)