From d56e1838a05aeb540fc9bcdd4fd755e21b650493 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 14 Sep 2023 22:35:12 -0600 Subject: [PATCH] Shallow clone Catch2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This takes a 4 second configuration time for the entire project with examples and tests and turns that into 3! Whopping 25% reduction in configuration time. This effect is likely to be even larger on machines without exceptionally good internet connections. Before: $ hyperfine 'rm -rf build && cmake --preset dev' Benchmark 1: rm -rf build && cmake --preset dev Time (mean ± σ): 4.076 s ± 0.130 s [User: 2.148 s, System: 1.376 s] Range (min … max): 3.963 s … 4.321 s 10 runs After: $ hyperfine 'rm -rf build && cmake --preset dev' Benchmark 1: rm -rf build && cmake --preset dev Time (mean ± σ): 3.007 s ± 0.313 s [User: 1.061 s, System: 1.160 s] Range (min … max): 2.783 s … 3.805 s 10 runs Co-authored-by: binary1248 --- test/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 82fc3eaa..a5de4137 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,8 @@ set(CATCH_CONFIG_FAST_COMPILE ON CACHE BOOL "") set(CATCH_CONFIG_NO_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT ON CACHE BOOL "") FetchContent_Declare(Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.4.0) + GIT_TAG v3.4.0 + GIT_SHALLOW ON) FetchContent_MakeAvailable(Catch2) include(Catch)