Skip to content

Commit 86ad019

Browse files
committed
build: enable CXX only if benchmarks are build
1 parent 92353d0 commit 86ad019

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.20)
66
project(bpfilter
77
VERSION 0.0.1
88
DESCRIPTION "BPF-based packet filtering framework"
9-
LANGUAGES C CXX
9+
LANGUAGES C
1010
)
1111

1212
include(GNUInstallDirs)

tools/benchmarks/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
# Copyright (c) 2023 Meta Platforms, Inc. and affiliates.
33

4+
enable_language(CXX)
5+
46
find_package(benchmark REQUIRED)
57
find_package(PkgConfig REQUIRED)
68
pkg_check_modules(bpf REQUIRED IMPORTED_TARGET libbpf)
@@ -11,14 +13,14 @@ add_executable(benchmark_bin
1113
benchmark.cpp benchmark.hpp
1214
)
1315

14-
target_include_directories(benchmark_bin
16+
target_compile_options(benchmark_bin
1517
PRIVATE
16-
${CMAKE_CURRENT_SOURCE_DIR}
18+
-std=c++20
1719
)
1820

19-
target_compile_options(benchmark_bin
21+
target_include_directories(benchmark_bin
2022
PRIVATE
21-
-std=c++20
23+
${CMAKE_CURRENT_SOURCE_DIR}
2224
)
2325

2426
target_link_libraries(benchmark_bin

0 commit comments

Comments
 (0)