From cae9708a00c9e2f69802b9fdb43cf7413ca25e83 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 29 Jun 2019 22:19:47 +0200 Subject: [PATCH] Revert "CMake: Get Git submodule dependencies via CMake (#2474)" This reverts commit 5cef446f42e698a524c6c3240fedb0031f8e5694. --- .travis/linux-mingw/build.sh | 5 ++--- CMakeLists.txt | 28 ++++++++++++++++------------ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.travis/linux-mingw/build.sh b/.travis/linux-mingw/build.sh index c32a909d3..b12d70b12 100755 --- a/.travis/linux-mingw/build.sh +++ b/.travis/linux-mingw/build.sh @@ -1,4 +1,3 @@ #!/bin/bash -ex - -mkdir -p "$HOME/.ccache" -docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-mingw /bin/bash /yuzu/.travis/linux-mingw/docker.sh +mkdir "$HOME/.ccache" || true +docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.travis/linux-mingw/docker.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a207f9e3..bfa104034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,18 +7,6 @@ include(CMakeDependentOption) project(yuzu) -# Get Git submodule dependencies -find_package(Git QUIET) -if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL "0") - message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, " - "please checkout submodules manually with \"git submodule update --init --recursive\"") - endif() -endif() - # Set bundled sdl2/qt as dependent options. # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) @@ -45,6 +33,22 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks) endif() +# Sanity check : Check that all submodules are present +# ======================================================================= + +function(check_submodules_present) + file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules) + string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules}) + foreach(module ${gitmodules}) + string(REGEX REPLACE "path *= *" "" module ${module}) + if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git") + message(FATAL_ERROR "Git submodule ${module} not found. " + "Please run: git submodule update --init --recursive") + endif() + endforeach() +endfunction() +check_submodules_present() + configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc COPYONLY)