I am making a plugin for UnrealHeaderTool.
I would like to know the proper way on how to output the cpp file.
↓Link to the project of the plugin you are creating
I am still implementing it with reference to the UHT built-in exporter “UhtCodeGenerator” and making sure that the output cpp file is built.
However, I am experiencing a bug where the generated cpp files are constantly regenerated under the influence of the ““UhtCodeGenerator”” code.
We have investigated and found the following
-
only “.gen.cpp” files are build targets
It seems that the cpp file generated in the “UEBuildModuleCPP” section is the target of compilation.
Looking at the code, I see that the extension cannot be specified here and must be “gen.cpp”. -
extra files are deleted at “UhtSession.CullOutputDirectory”.
The file format of each exporter’s output file format is used to delete unnecessary files. (This is for automatic deletion when the h file on the project side is deleted.
Deletion is performed according to the naming convention of CppFilters and HeaderFilters of each exporter.
Since “*.gen.cpp” is included in the CppFilters written in “UhtCodeGenerator”, the code of the home-made plugin seems to be deleted during the session of UhtCodeGenerator.