Skip to content

Commit 1102347

Browse files
authored
build: enable treating warnings as errors (#48)
* build: enable flag to treat warnings as errors * ci: remove Check Warning job in the CI workflow
1 parent 84c4669 commit 1102347

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@ jobs:
3636
excludes: build/*
3737
fail-under-line: 80
3838

39-
check-warning:
40-
name: Check Warning
41-
runs-on: ubuntu-latest
42-
steps:
43-
- name: Checkout repository
44-
uses: actions/[email protected]
45-
46-
- name: Configure and build this project
47-
uses: threeal/[email protected]
48-
with:
49-
cxx-flags: -Werror
50-
args: -DBUILD_TESTING=ON
51-
run-build: true
52-
5339
check-formatting:
5440
name: Check Formatting
5541
runs-on: ubuntu-latest

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(example)
44

55
add_library(example src/example.cpp)
66
target_include_directories(example PUBLIC include)
7-
target_compile_options(example PRIVATE -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wpedantic)
7+
target_compile_options(example PRIVATE -Werror -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wpedantic)
88

99
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
1010
include(cmake/CPM.cmake)
@@ -21,7 +21,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
2121

2222
add_executable(example_test test/example_test.cpp)
2323
target_link_libraries(example_test PRIVATE example Catch2::Catch2WithMain)
24-
target_compile_options(example_test PRIVATE -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wpedantic)
24+
target_compile_options(example_test PRIVATE -Werror -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wpedantic)
2525
catch_discover_tests(example_test)
2626
endif()
2727
endif()

0 commit comments

Comments
 (0)