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

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