Open deadlocklogic opened 1 year ago
IIRC by default it should only work as you want, it only generates translation units added by the user.
Are you using the default driver for generation or you write your own?
EDIT: See here: https://github.com/mono/CppSharp/blob/main/src/Generator/Generator.cs#L157C47-L157C59 https://github.com/mono/CppSharp/blob/main/src/AST/ClassExtensions.cs#L181
Ok, so to achieve what you want I think you need to set unit.GenerationKind
.
If you want to add an option to change the default generation behaviour then I think that would be fine.
Are you using the default driver for generation or you write your own?
No I am testing using the default Driver
and GeneratorKind.CPlusPlus
.
I find it an issue because I don't want to generate code for third-party dependencies. (Because they might have a separate external modular generation).
@tritao Could we add for any unit not provided explicitly in Module.Headers
and generated by the parser, an option in the DriverOptions
to mark its TranslationUnit.GenerationKind
to GenerationKind.Internal
?
@tritao Could we add for any unit not provided explicitly in
Module.Headers
and generated by the parser, an option in theDriverOptions
to mark itsTranslationUnit.GenerationKind
toGenerationKind.Internal
?
Sure, I think that's ok.
Consider:
Now if
Test2.h
includesTest3.h
then we will have 3TranslationUnit
for generation. Is there a way to restrict the generation toTest1.h/Test2.h
only? (I know thatTest3.h
is necessary for symbol resolution but I don't want it to be generated as output).