Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Support (automatically) building the inline reference file separately

Open PathogenDavid opened this issue 3 years ago • 2 comments

Biohazrd requires building a small native component to access inline functions which aren't exported. There's not really any way around this because during typical C++ library consumption these inline functions would've become part of your consuming app.

In InfectedPhysX, we modified PhysX to include this native component. This was acceptable in the case of PhysX because there were some other minor changes we wanted to make that necessitated a fork, but this approach may not be appropriate in some cases, especially in cases where the library is closed source.

To support these scenarios, we should provide investigate automatically building a dll for the inline reference file. In theory this shouldn't be too hard since we embed Clang, but it might not be super simple for the cross-compilation scenarios.

At the very least we should provide some guidance on ways to build it separately for those who do not or cannot modify the native library.

PathogenDavid avatar Nov 07 '20 08:11 PathogenDavid

In an unrelated discussion about Clang on Twitter I found that Clang's individual command line tools are nicely self-contained. So I think it would be pretty reasonable that we just emit this automagically.

PathogenDavid avatar Nov 30 '20 22:11 PathogenDavid

Along with this, make sure to write documentation for InlineExportHelper. (I did not write documentation when committing it because how you use it depends largely on this issue being completed.)

PathogenDavid avatar Feb 21 '21 10:02 PathogenDavid