Closed waldnercharles closed 2 years ago
I'll add the test case to the integration test when the multi-pass
branch is merged.
Merged the branch in. I'll take a look at this tomorrow.
This requires a re-design for knowing which "nodes" (function, type, etc) are dependent on other nodes. Trimming one node (trimming all nodes of a specific file) should cascade and remove any other nodes in other files which have no "parent" (leaf nodes). In other words, a node should always have a parent node unless it is an entry point for P/Invoke such as a function or variable.
I think I came up with a possible idea for a simpler solution. It sounds janky but...
"Pre-pass":
"Normal-pass":
@waldnercharles I fixed this and added a test for it for regression. See pull request #94.
If a file is included in
excludedHeaderFiles
but doesn't declare any types or functions, it will not be excluded. This is a problem when the header file is including other header files that do declare types.A good example of this is
windows.h
. It doesn't declare any types itself, but includes quite a few headers that will be visited duringExploreTranslationUnit
.An easy way to replicate the issue is to do the following:
In the example above,
MyStruct
will be generated inLibrary.cs
.Alternatively on windows, just try to
#include <windows.h>
and"excludeHeaderFiles": ["windows.h"]