diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f57a5fbd..ab52b8e2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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}")