searching for a tool to find superfluous includes

hello Nordic

i am working with zephyr NCS(1.7.1) , with vs code (on manjaro) with the nRF connect extension.

i am looking for a way to map my include files, to find dependencies and get an overall look/graph of the include in my application

1. do you know of such tool ?

2. there is an extension on vs code - "include-what-you-use" (also known as IWYU) , but i can not find a proper tutorial as for how to set it and work with it 

so if you know and can help on that matter that would be great

hope to read you soon

best regards

Ziv

Parents Reply Children
  • hi Vidar

    i am looking for a visual graph to see all includes and file relations within a growing project 

    we have dependencies cause of include chains that we want to avoid to be able to have more independent modules for start second we want to exclude unused includes

    this is the goal, 

    there are some tools but i am not sure how to implement them in the CMakeLists file or if there is another way or some build in zephyr tool for having a visual graph of project .c and .h files and relations

    there is codeviz that can give some kind of graph, there is cinclude2dot that i am not yet sure how to work with it

    i know that if i add -H i only get a list of the headers which does not really help

    hope to read you soon

    best regards

    Ziv

  • Hi Ziv,

    Thanks for the clarification. This is not something I have seen used before, but I will try to ask around here to see if anyone knows of a zephyr compatible tool that can be used for this purpose.You could also try to post this question on discord.

    Best regards,

    Vidar

Related