Skip to content

Commit c8eee02

Browse files
committed
Add build option to enable -Werror, use in CI
1 parent 2298c4e commit c8eee02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ project(popt
1212
# Set soversion
1313
set(POPT_SOVERSION 0)
1414

15+
# Configurable stuff
16+
option(ENABLE_WERROR "Stop build on warnings" OFF)
17+
1518
# Set up GNU conventions and standard FHS paths
1619
include(GNUInstallDirs)
1720

@@ -79,6 +82,9 @@ if (Iconv_FOUND)
7982
endif()
8083

8184
add_compile_options(-Wall)
85+
if (ENABLE_WERROR)
86+
add_compile_options(-Werror)
87+
endif()
8288

8389
add_subdirectory(src)
8490
add_subdirectory(doc)

Diff for: ci/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ RUN dnf -y install \
1616

1717
COPY . .
1818

19-
RUN cmake -S . -B ./build
19+
RUN cmake -S . -B ./build -DENABLE_WERROR=ON
2020
CMD cd build && ctest --output-on-failure --force-new-ctest-process

0 commit comments

Comments
 (0)