ci: fix git submodule update --init race condition
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 04:41:43 +01:00
parent 02de37baa2
commit e7cce999a0
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -10,10 +10,24 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
OPTION(TIDY "Run clang-tidy" OFF)
OPTION(VALGRIND "Run valgrind" OFF)
OPTION(SAN "Build with sanitize flags" OFF)
if(DEFINED ENV{CI})
if($ENV{CI} MATCHES "true")
message(STATUS "We're in CI!")
OPTION(IS_CI "Are we in CI?" ON)
endif()
else()
OPTION(IS_CI "Are we in CI?" OFF)
endif()
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
option(GIT_SUBMODULE "Check submodules during build" ON)
if(IS_CI)
# there seems to be a race condition so the submodules are simply
# initialized/updated in a separate step and therefore this is not needed
option(GIT_SUBMODULE "Check submodules during build" OFF)
else()
option(GIT_SUBMODULE "Check submodules during build" ON)
endif()
if(GIT_SUBMODULE)
message(STATUS "Update submodule(s)")
message(STATUS "Current source dir: ${CMAKE_CURRENT_SOURCE_DIR}")