summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Frederic L2019-06-20 04:26:12 +0200
committerGravatar bunnei2019-06-19 22:26:12 -0400
commit5cef446f42e698a524c6c3240fedb0031f8e5694 (patch)
treeefefc9c889a14bba9f47e72f1bb83a44f0679e68
parentMerge pull request #2594 from FearlessTobi/very-important-change (diff)
downloadyuzu-5cef446f42e698a524c6c3240fedb0031f8e5694.tar.gz
yuzu-5cef446f42e698a524c6c3240fedb0031f8e5694.tar.xz
yuzu-5cef446f42e698a524c6c3240fedb0031f8e5694.zip
CMake: Get Git submodule dependencies via CMake (#2474)
* CMake: Get Git submodule dependencies via CMake * CMakeLists: Fixed unintentional line break * travis: Bring parity between linux-mingw and linux build script * CMakeLists: Fixed typo in error message
-rwxr-xr-x.travis/linux-mingw/build.sh5
-rw-r--r--CMakeLists.txt28
2 files changed, 15 insertions, 18 deletions
diff --git a/.travis/linux-mingw/build.sh b/.travis/linux-mingw/build.sh
index b12d70b12..c32a909d3 100755
--- a/.travis/linux-mingw/build.sh
+++ b/.travis/linux-mingw/build.sh
@@ -1,3 +1,4 @@
1#!/bin/bash -ex 1#!/bin/bash -ex
2mkdir "$HOME/.ccache" || true 2
3docker 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 3mkdir -p "$HOME/.ccache"
4docker 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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfa104034..9a207f9e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,18 @@ include(CMakeDependentOption)
7 7
8project(yuzu) 8project(yuzu)
9 9
10# Get Git submodule dependencies
11find_package(Git QUIET)
12if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
13 execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
14 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
15 RESULT_VARIABLE GIT_SUBMOD_RESULT)
16 if(NOT GIT_SUBMOD_RESULT EQUAL "0")
17 message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, "
18 "please checkout submodules manually with \"git submodule update --init --recursive\"")
19 endif()
20endif()
21
10# Set bundled sdl2/qt as dependent options. 22# Set bundled sdl2/qt as dependent options.
11# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON 23# OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
12option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) 24option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
@@ -33,22 +45,6 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
33 DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks) 45 DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks)
34endif() 46endif()
35 47
36# Sanity check : Check that all submodules are present
37# =======================================================================
38
39function(check_submodules_present)
40 file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules)
41 string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
42 foreach(module ${gitmodules})
43 string(REGEX REPLACE "path *= *" "" module ${module})
44 if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
45 message(FATAL_ERROR "Git submodule ${module} not found. "
46 "Please run: git submodule update --init --recursive")
47 endif()
48 endforeach()
49endfunction()
50check_submodules_present()
51
52configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc 48configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc
53 ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc 49 ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
54 COPYONLY) 50 COPYONLY)