From 3eea90afb67b50c776c77895b262d0451702965c Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 13 Sep 2024 16:29:25 +0000 Subject: [PATCH] build: set BUILD_TESTING=OFF when not git checkout Signed-off-by: Rafael Kitover --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0e8584b..fb444538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,11 @@ include(Options) include(Toolchain) include(Dependencies) +# Disable tests when not in a git checkout. +if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git") + set(BUILD_TESTING OFF) +endif() + # Configure gtest if(BUILD_TESTING) FetchContent_Declare(googletest