summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDaniel Black <daniel.black@au.ibm.com>2017-08-22 15:56:53 +1000
committerSergey Vojtovich <svoj@mariadb.org>2017-08-29 22:50:16 +0400
commitacaac7c233ef608bed28ab57e6631303fd6568ff (patch)
treec6775d7bb175590cf3db5df915166b8c1ec4a56f /cmake
parentf192b48d620d0e412a8324dda65a143c2852619e (diff)
downloadmariadb-git-acaac7c233ef608bed28ab57e6631303fd6568ff.tar.gz
submodules.cmake: git returns 128 if not in a repository
It is possible that a .git directory isn't definitive on the existance of a working git tree. A git worktree over sshfs for instance will fail to build unless the main repository also exists in the same directory. Adding this extra test will make the detection that little more ruggardised for these odd build environments. Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/submodules.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake
index 61eacba7c73..86e3d41eb77 100644
--- a/cmake/submodules.cmake
+++ b/cmake/submodules.cmake
@@ -2,8 +2,9 @@
IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" config --get cmake.update-submodules
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
- OUTPUT_VARIABLE cmake_update_submodules)
- IF(cmake_update_submodules MATCHES no)
+ OUTPUT_VARIABLE cmake_update_submodules
+ RESULT_VARIABLE git_config_get_result)
+ IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no)
SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE("-- Updating submodules (forced)")