build: set BUILD_TESTING=OFF when not git checkout

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2024-09-13 16:29:25 +00:00
parent b3952d74a8
commit 3eea90afb6
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 5 additions and 0 deletions

View File

@ -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