Are there any tools that can generate dependency diagrams for Delphi units taking into account conditional compilation directives. I\'d like to emphasize that this should be
I personally use the free Project Dependencies from GExperts.
It does not display a diagram, but as a tree view. That suits my needs, YMMV.
See this related question, where Peganza was discussed. Tool that shows unit dependencies for Delphi 2010 or Delphi 7 program
You can also use the Delphi Unit Dependency Scanner from https://github.com/norgepaul/DUDS and export the tree in Gephi or yEd format.
Then you can build the graph, analyze and do many other actions with the graph using the open source tool from https://gephi.org/ or free https://www.yworks.com/products/yed.
I use ModelMakers Unit Dependency Analyzer together with Lattix LDM.
The open source pascal code documentation tool PasDoc can do that too
Perhaps ICARUS is helpful.