Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create option BPF_CONFORMANCE_ENABLE_TESTS #128

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ jobs:
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_CXX_FLAGS="${SANITIZER_FLAGS}" \
-DCMAKE_C_FLAGS="${SANITIZER_FLAGS}" \
${COVERAGE_FLAGS}
${COVERAGE_FLAGS} \
-DBPF_CONFORMANCE_ENABLE_TESTS=ON

- name: Build
# Build your program with the given configuration
Expand Down
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
project("bpf_conformance")
cmake_minimum_required(VERSION 3.16)

if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
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 ()
DESTINATION "${PROJECT_SOURCE_DIR}/.git/hooks")
endif()

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/ZH:SHA_256 /guard:cf /Qspectre /sdl)
add_link_options(/guard:cf /CETCOMPAT)
endif()

option(BPF_CONFORMANCE_ENABLE_TESTS "Enable tests")

include("cmake/FindLibBpf.cmake")
include(CTest)

Expand All @@ -34,7 +36,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(COPY Docker/Linux/Dockerfile DESTINATION .)
endif()


if (LIBBPF_FOUND)
if(BPF_CONFORMANCE_ENABLE_TESTS)
if(LIBBPF_FOUND)
add_subdirectory("libbpf_plugin")
endif()
endif()
endif()
Loading