Skip to content
Snippets Groups Projects
Commit 2d9afbcb authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

CMake: detect missing submodules properly

Fix misleading "C atomics not supported" when git submodules
are missing.

Closes #2088
parent a305d08e
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,23 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()
#
# Check submodules
#
function(update_submodules)
message(STATUS "Updating submodules")
execute_process(COMMAND ${GIT} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endfunction()
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/lib/small/CMakeLists.txt)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND GIT)
update_submodules()
else()
message(FATAL_ERROR "Failed to find submodules")
endif()
endif()
# Define GNU standard installation directories
include(GNUInstallDirs)
......@@ -149,9 +166,7 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND GIT)
message(STATUS "Generating VERSION file")
file(WRITE ${VERSION_FILE} "${TARANTOOL_VERSION}\n")
message(STATUS "Updating submodules")
execute_process(COMMAND ${GIT} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
update_submodules()
endif()
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment