Skip to content

Commit 11c0470

Browse files
chore(examples): make build fail on any warning
1 parent cf02e6e commit 11c0470

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@ build --//core:codspeed_mode=instrumentation
22
build --compilation_mode=dbg
33
build --copt=-O2
44

5+
# Treat warnings as errors
6+
build --copt=-Wall
7+
build --copt=-Wextra
8+
build --copt=-Werror
9+
510
# Flip this early to avoid breaking compatibility once it becomes the default.
611
build --incompatible_disallow_empty_glob

core/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ project(codspeed VERSION ${CODSPEED_VERSION} LANGUAGES CXX)
88
set(CMAKE_CXX_STANDARD 17)
99
set(CMAKE_CXX_STANDARD_REQUIRED True)
1010

11+
# Treat warnings as errors
12+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
13+
add_compile_options(-Wall -Wextra -Werror)
14+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
15+
add_compile_options(/W4 /WX)
16+
endif()
17+
1118
# Add the include directory
1219
include_directories(include)
1320

0 commit comments

Comments
 (0)