Skip to content

Commit a2e1556

Browse files
committed
Merge branch 'unstable' into 3.0.x
2 parents c730fd7 + 4c19765 commit a2e1556

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

deps/external_dependency.cmake

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,18 @@ function(external_dependency)
7272
set(src_dir ${bin_dir}_src)
7373
if(NOT IS_DIRECTORY ${src_dir})
7474
if(ARG_GIT_TAG)
75-
set(clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false)
75+
set(clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false)
76+
endif()
77+
if(NOT GIT_EXECUTABLE)
78+
find_package(Git REQUIRED)
79+
endif()
80+
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir}
81+
RESULT_VARIABLE clone_failed
82+
ERROR_VARIABLE clone_error
83+
)
84+
if(clone_failed)
85+
message(FATAL_ERROR "Failed to clone sources for dependency ${ARGV0}.\n ${clone_error}")
7686
endif()
77-
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
7887
endif()
7988
add_subdirectory(${src_dir} ${bin_dir} ${subdir_opts})
8089
else()

0 commit comments

Comments
 (0)