Skip to content

Commit a3a9eb8

Browse files
chore(examples): make build fail on any warning
1 parent 308c879 commit a3a9eb8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

examples/google_benchmark_bazel/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cc_binary(
22
name = "my_benchmark",
33
srcs = glob(["*.cpp", "*.hpp"]),
4+
copts = ["-Wall", "-Wextra", "-Werror"],
45
deps = [
56
"//google_benchmark:benchmark",
67
],

examples/google_benchmark_cmake/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ include(FetchContent)
33

44
project(codspeed_picobench_compat VERSION 0.0.0 LANGUAGES CXX)
55

6+
# Treat warnings as errors
7+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
8+
add_compile_options(-Wall -Wextra -Werror)
9+
endif()
10+
611
# On the small benchmarks of this repo, most of the benches will be optimized out, but this is expected.
712
set(CMAKE_BUILD_TYPE RelWithDebInfo)
813

0 commit comments

Comments
 (0)