Skip to content

Commit

Permalink
Add build option to enable -Werror, use in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatilai committed Mar 4, 2024
1 parent 2298c4e commit c8eee02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ project(popt
# Set soversion
set(POPT_SOVERSION 0)

# Configurable stuff
option(ENABLE_WERROR "Stop build on warnings" OFF)

# Set up GNU conventions and standard FHS paths
include(GNUInstallDirs)

Expand Down Expand Up @@ -79,6 +82,9 @@ if (Iconv_FOUND)
endif()

add_compile_options(-Wall)
if (ENABLE_WERROR)
add_compile_options(-Werror)
endif()

add_subdirectory(src)
add_subdirectory(doc)
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ RUN dnf -y install \

COPY . .

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

0 comments on commit c8eee02

Please sign in to comment.