Skip to content

Commit

Permalink
fix cmake submodule sync for third party dependencies (#61704)
Browse files Browse the repository at this point in the history
* fix cmake submodule sync for third party dependencies

* fix sequential execution of multiple commands use execute_process

* fix sequential execution of multiple commands on Windows platform
  • Loading branch information
silverling authored Feb 21, 2024
1 parent 222734d commit 85e37db
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,25 @@ if(NOT WITH_SETUP_INSTALL)
#NOTE(risemeup1):Initialize any submodules.
message(
STATUS
"Check submodules of paddle, and run 'git submodule update --init --recursive'"
"Check submodules of paddle, and run 'git submodule sync --recursive && git submodule update --init --recursive'"
)

# execute_process does not support sequential commands, so we execute echo command separately
execute_process(
COMMAND git submodule sync --recursive
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
RESULT_VARIABLE result_var)
if(NOT result_var EQUAL 0)
message(FATAL_ERROR "Failed to sync submodule, please check your network !")
endif()

execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
RESULT_VARIABLE result_var)
if(NOT result_var EQUAL 0)
message(FATAL_ERROR "Failed to get submodule, please check your network !")
message(
FATAL_ERROR "Failed to update submodule, please check your network !")
endif()

endif()
Expand Down

0 comments on commit 85e37db

Please sign in to comment.