From a2490ef63a2e4c7c3c8315f88628cad0b022fc03 Mon Sep 17 00:00:00 2001 From: redtide Date: Thu, 4 Jan 2024 09:35:50 +0100 Subject: [PATCH] Added SFIZZ_GIT_SUBMODULE_CHECK flag this flag it's necessary when updating a submodule, to avoid CMake to restore the previous state when configuring before a test build. --- CMakeLists.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8559861..2f08e6bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,17 +16,6 @@ set(PROJECT_REPOSITORY https://github.com/sfztools/sfizz) # External configuration CMake scripts set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") -# Ensure presence of Git submodules (when not using the source tarball) -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND NOT CMAKE_VERSION VERSION_LESS "3.19.0") - include(GitSubmoduleCheck) - git_submodule_check(external/abseil-cpp) - git_submodule_check(external/filesystem) - git_submodule_check(external/simde) - git_submodule_check(external/st_audiofile/thirdparty/dr_libs) - git_submodule_check(external/st_audiofile/thirdparty/libaiff) - git_submodule_check(external/st_audiofile/thirdparty/wavpack) -endif() - include(BuildType) # Build Options @@ -54,10 +43,23 @@ option_ex(SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF) option_ex(SFIZZ_PROFILE_BUILD "Profile the build time" OFF) option_ex(SFIZZ_SNDFILE_STATIC "Link the sndfile library statically" OFF) option_ex(SFIZZ_ASAN "Use address sanitizer on all sfizz targets" OFF) +option_ex(SFIZZ_GIT_SUBMODULE_CHECK "Check Git submodules presence" ON) # Continuous Controller count (0 to 511) set(MIDI_CC_COUNT 512 CACHE STRING "Maximum number of managed Control Change messages") +# Ensure presence of Git submodules (when not using the source tarball) +if(SFIZZ_GIT_SUBMODULE_CHECK AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" + AND NOT CMAKE_VERSION VERSION_LESS "3.19.0") + include(GitSubmoduleCheck) + git_submodule_check(external/abseil-cpp) + git_submodule_check(external/filesystem) + git_submodule_check(external/simde) + git_submodule_check(external/st_audiofile/thirdparty/dr_libs) + git_submodule_check(external/st_audiofile/thirdparty/libaiff) + git_submodule_check(external/st_audiofile/thirdparty/wavpack) +endif() + include(SfizzConfig) include(SfizzDeps) include(SfizzFaust)