Skip to content

Commit

Permalink
CMake: Build everything with -Werror
Browse files Browse the repository at this point in the history
When COMPILE_WARNING_AS_ERROR is set, compile everything with -Werror
and not just Libiio.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Dec 5, 2023
1 parent d9cd027 commit 086930f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ if (MSVC)
# Azure Pipelines: TF_BUILD=True
if(COMPILE_WARNING_AS_ERROR)
message(STATUS "Setting -Werror")
target_compile_options(iio PRIVATE /WX)
target_compile_options(iio PUBLIC /WX)
endif()
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
option(WITH_GCOV "Build with gcov profiling flags" OFF)
Expand All @@ -318,7 +318,7 @@ elseif (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
endif()
if(COMPILE_WARNING_AS_ERROR)
message(STATUS "Setting -Werror")
target_compile_options(iio PRIVATE -Werror)
target_compile_options(iio PUBLIC -Werror)
endif()
else()
message(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
Expand Down

0 comments on commit 086930f

Please sign in to comment.