Skip to content

Commit 706639a

Browse files
skip paddle submoduble (PaddlePaddle#1381)
1 parent 20f63b2 commit 706639a

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

cmake/paddle.cmake

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,24 @@ if(NO_PADDLE_SUBMODULE)
6969
endif()
7070

7171
# submodule Paddle first
72-
get_filename_component(REPO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../"
73-
ABSOLUTE)
74-
message(STATUS "Run 'git submodule update --init Paddle' in ${REPO_SOURCE_DIR}")
75-
execute_process(
76-
COMMAND git submodule update --init Paddle
77-
WORKING_DIRECTORY ${REPO_SOURCE_DIR}
78-
RESULT_VARIABLE result_var)
79-
if(NOT result_var EQUAL 0)
72+
if(paddle_submodule)
8073
message(
81-
FATAL_ERROR "Failed to get submodule Paddle', please check your network !")
82-
endif()
74+
"Paddle submodule already exists, skip git submodule update --init Paddle")
75+
else()
76+
get_filename_component(REPO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../"
77+
ABSOLUTE)
78+
message(
79+
STATUS "Run 'git submodule update --init Paddle' in ${REPO_SOURCE_DIR}")
80+
execute_process(
81+
COMMAND git submodule update --init Paddle
82+
WORKING_DIRECTORY ${REPO_SOURCE_DIR}
83+
RESULT_VARIABLE result_var)
84+
if(NOT result_var EQUAL 0)
85+
message(
86+
FATAL_ERROR "Failed to get submodule Paddle', please check your network !"
87+
)
88+
endif()
8389

84-
get_filename_component(PADDLE_SOURCE_DIR "${REPO_SOURCE_DIR}/Paddle" ABSOLUTE)
85-
message(STATUS "PADDLE_SOURCE_DIR=${PADDLE_SOURCE_DIR}")
90+
get_filename_component(PADDLE_SOURCE_DIR "${REPO_SOURCE_DIR}/Paddle" ABSOLUTE)
91+
message(STATUS "PADDLE_SOURCE_DIR=${PADDLE_SOURCE_DIR}")
92+
endif()

0 commit comments

Comments
 (0)