target_compile_options seems to not be making any effect

albertabac
Posts: 1
Joined: Sun Mar 12, 2023 8:03 am

target_compile_options seems to not be making any effect

Postby albertabac » 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!

Who is online

Users browsing this forum: Frostie314159, MicroController and 68 guests