diff --git a/cmake/modules/unittest.cmake b/cmake/modules/unittest.cmake index 6565e89aec53a77..eac854bb32698b3 100644 --- a/cmake/modules/unittest.cmake +++ b/cmake/modules/unittest.cmake @@ -130,6 +130,10 @@ if(CONFIG_COVERAGE) target_link_libraries(testbinary PRIVATE $) endif() +if (CONFIG_COMPILER_WARNINGS_AS_ERRORS) + target_compile_options(test_interface INTERFACE $) +endif() + if(LIBS) message(FATAL_ERROR "This variable is not supported, see SOURCES instead") endif()