Skip to content

Commit

Permalink
Use SYSTEM INTERFACE includes to supporess warnings
Browse files Browse the repository at this point in the history
This is useful in case the file including a header has more warnings
enabled than the esp-idf default.
  • Loading branch information
Barabas5532 committed Apr 20, 2022
1 parent 8153bfe commit 3df8e0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/cmake/component.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,13 @@ macro(__component_add_include_dirs lib dirs type)
if(NOT IS_DIRECTORY ${_dir})
message(FATAL_ERROR "Include directory '${_dir}' is not a directory.")
endif()
target_include_directories(${lib} ${type} ${_dir})

if("${type}" STREQUAL "PUBLIC")
target_include_directories(${lib} SYSTEM INTERFACE ${_dir})
target_include_directories(${lib} PRIVATE ${_dir})
else()
target_include_directories(${lib} ${type} ${_dir})
endif()
endforeach()
endmacro()

Expand Down

0 comments on commit 3df8e0c

Please sign in to comment.