Skip to content

Commit

Permalink
DONT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Oct 11, 2024
1 parent 079859f commit 21e15a5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion cmake/CDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,36 @@ function(cdeps_download_package NAME URL REF)
endif()
endif()

message(STATUS "CDeps: Downloading ${NAME} from ${GIT_URL} at ${REF}")

execute_process(
COMMAND "${GIT_EXECUTABLE}" clone --no-checkout --depth 1
https://${URL}.git ${CDEPS_DIR}/${NAME}/src
ERROR_VARIABLE ERR
RESULT_VARIABLE RES
OUTPUT_QUIET)
if(NOT "${RES}" EQUAL 0)
file(REMOVE_RECURSE ${CDEPS_DIR}/${NAME}/src)
message(FATAL_ERROR "CDeps: Failed to clone ${GIT_URL}: ${ERR}")
return()
endif()

execute_process(
COMMAND "${GIT_EXECUTABLE}" fetch --depth 1 origin "${REF}"
ERROR_VARIABLE ERR
RESULT_VARIABLE RES
OUTPUT_QUIET)
if(NOT "${RES}" EQUAL 0)
file(REMOVE_RECURSE ${CDEPS_DIR}/${NAME}/src)
message(FATAL_ERROR "CDeps: Failed to fetch "${REF}" from ${GIT_URL}: ${ERR}")
return()
endif()

set(CLONE_OPTS -b "${REF}" --depth 1)
if(ARG_RECURSE_SUBMODULES)
list(APPEND CLONE_OPTS --recurse-submodules)
endif()

message(STATUS "CDeps: Downloading ${NAME} from ${GIT_URL} at ${REF}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone ${CLONE_OPTS} https://${URL}.git
${CDEPS_DIR}/${NAME}/src
Expand Down

0 comments on commit 21e15a5

Please sign in to comment.