Run logic after a C# UHT Exporter (UBT Plugin) but before C++ compilation?

I wrote a UHT exporter plugin (using [UhtExporter] attribute) that generates some extra code which needs to be compiled (and linked with the program statically).

Is there a callback for when I can compile it? I need to do so after UHT runs, but before UBT’s linking steps begin.

I can’t put this code at the end of the exporter, because the exporter might altogether not run, in case no headers are updated, but I still need to compile my extra generated code (because one of its dependencies might have been updated by the user).

I also can’t put this code in a PreBuildSteps array, because that code runs before UHT exporters do.

Tried to make my UBT Plugin run using a prebuild step that starts another instance of UBT (with UHT Mode, and my specific plugin), but this has a new problem

factory.CommitOutput doesn’t work as intended, and it always updates the output file, even when there are no changes, and this is slowing down the builds