From 45135745ee61d916d3079499bc6d5ce11eb5b37e Mon Sep 17 00:00:00 2001 From: haonanya Date: Wed, 5 Jan 2022 10:32:19 +0800 Subject: [PATCH] Exit CMake processing when apply patch failed Signed-off-by: haonanya --- cmake/modules/CMakeFunctions.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/modules/CMakeFunctions.cmake b/cmake/modules/CMakeFunctions.cmake index af6f9e6c..9dde18b0 100644 --- a/cmake/modules/CMakeFunctions.cmake +++ b/cmake/modules/CMakeFunctions.cmake @@ -146,6 +146,7 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret) WORKING_DIRECTORY ${repo_dir} OUTPUT_VARIABLE patching_log ERROR_QUIET + RESULT_VARIABLE ret_apply_patch ) message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}") endif() @@ -161,6 +162,8 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret) endif() if (NOT (ret_not_git_repo OR ret_check_out OR ret_apply_patch)) set(${ret} True PARENT_SCOPE) + else() + message(FATAL_ERROR "[OPENCL-CLANG] Failed to apply patch!") endif() endfunction()