From 4148080eb527b5155f5eb865eb793ba98a74ed10 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 21 Aug 2020 07:03:35 +0000 Subject: [PATCH] Always update Win32 dependencies git submodule. Instead of just checking if the submodule has been cloned, always update it when cmake runs if git is available. This fixes the problem of users' dependencies submodule clone never getting updated with new changes. Signed-off-by: Rafael Kitover --- CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e7d0741..d4ca6579 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,18 +209,18 @@ option(ENABLE_LTO "Compile with Link Time Optimization (gcc and clang only)" ${L if(WIN32 OR CMAKE_TOOLCHAIN_FILE MATCHES "[Mm][Ii][Nn][Gg][Ww]") # Win32 deps submodule + set(git_checkout FALSE) + + if(EXISTS "${CMAKE_SOURCE_DIR}/.git") + set(git_checkout TRUE) + execute_process( + COMMAND git submodule update --init --remote --recursive + RESULT_VARIABLE git_status + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + ) + endif() + if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include") - set(git_checkout FALSE) - - if(EXISTS "${CMAKE_SOURCE_DIR}/.git") - set(git_checkout TRUE) - execute_process( - COMMAND git submodule update --init --remote --recursive - RESULT_VARIABLE git_status - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - ) - endif() - if(NOT (git_checkout AND git_status EQUAL 0)) message(FATAL_ERROR "Please pull in git submodules, e.g.\nrun: git submodule update --init --remote --recursive") endif()