target_compile_options seems to not be making any effect
Posted: Sun Mar 12, 2023 8:05 am
target_compile_options seems to not be making any effect. I have the following CMakeLists.txt inside the component:
idf_component_register(SRCS "nvs_manager.c"
INCLUDE_DIRS "include"
REQUIRES nvs_flash)
target_compile_options(${COMPONENT_LIB} PUBLIC -Wall -Werror=all)
Inside the file nvs_manager.c, I have an unused variable inside a function, so I would expect a compilation error, due to Werror compilation flag. The warning is seen in the build, but it does not trigger a compilation error.
Any idea what could be going on? Thanks!
idf_component_register(SRCS "nvs_manager.c"
INCLUDE_DIRS "include"
REQUIRES nvs_flash)
target_compile_options(${COMPONENT_LIB} PUBLIC -Wall -Werror=all)
Inside the file nvs_manager.c, I have an unused variable inside a function, so I would expect a compilation error, due to Werror compilation flag. The warning is seen in the build, but it does not trigger a compilation error.
Any idea what could be going on? Thanks!