From e6ceb8f5e6588e5267f9272066e2e0b8cd4ee7ca Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Mon, 21 Oct 2024 09:29:03 -0700 Subject: [PATCH] When including ebpf-verifier as a submodule, default to tests off Signed-off-by: Alan Jowett --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77e288740..b7da01f57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,16 @@ project(ebpf_verifier) include(FetchContent) -option(VERIFIER_ENABLE_TESTS "Build tests" ON) +if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git") + # Install Git pre-commit hook + file(COPY scripts/pre-commit scripts/commit-msg + DESTINATION "${PROJECT_SOURCE_DIR}/.git/hooks") + option(VERIFIER_ENABLE_TESTS "Build tests" ON) +else() + option(VERIFIER_ENABLE_TESTS "Build tests" OFF) +endif () + +message("Building tests: ${VERIFIER_ENABLE_TESTS}") FetchContent_Declare(GSL GIT_REPOSITORY "https://github.com/microsoft/GSL" @@ -24,11 +33,6 @@ FetchContent_Declare(Catch2 FetchContent_MakeAvailable(Catch2) endif() -if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git") - # Install Git pre-commit hook - file(COPY scripts/pre-commit scripts/commit-msg - DESTINATION "${PROJECT_SOURCE_DIR}/.git/hooks") -endif () if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")