Skip to content

Commit

Permalink
build: enable CXX only if benchmarks are build
Browse files Browse the repository at this point in the history
  • Loading branch information
qdeslandes committed Feb 4, 2025
1 parent a8313ab commit f9377ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.20)
project(bpfilter
VERSION 0.0.1
DESCRIPTION "BPF-based packet filtering framework"
LANGUAGES C CXX
LANGUAGES C
)

include(GNUInstallDirs)
Expand Down
10 changes: 6 additions & 4 deletions tools/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2023 Meta Platforms, Inc. and affiliates.

enable_language(CXX)

find_package(benchmark REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(bpf REQUIRED IMPORTED_TARGET libbpf)
Expand All @@ -11,14 +13,14 @@ add_executable(benchmark_bin
benchmark.cpp benchmark.hpp
)

target_include_directories(benchmark_bin
target_compile_options(benchmark_bin
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
-std=c++20
)

target_compile_options(benchmark_bin
target_include_directories(benchmark_bin
PRIVATE
-std=c++20
${CMAKE_CURRENT_SOURCE_DIR}
)

target_link_libraries(benchmark_bin
Expand Down

0 comments on commit f9377ff

Please sign in to comment.