Hi,
I have a project that I have to export to WebGL. In that project I’m using a native plugin built in C++ using CMake to instruct how to build itself and how to discover its dependencies.
The Unity project works in almost every platform except for the WebGL. As WebGL doesn’t allow to load dll files, I need to build the plugin from the source code so the code can get converted to js code.
So far I’m using a dummy cpp file (that I put in Assets/Plugins/WebGL folder) that the only thing that does it is to include the main source files of my plugin source folder.
The problem comes when I need to resolve things like “#include ” where its location is well-known when I use CMake to build the library but it isn’t when I include them directly from unity. The project also defines dependencies and those dependencies also used CMake to generate their compilation rules.
So the questions are:
How can I define the includes folders so they can be used when building the library from Unity (similar to how ‘include_directories’ does it in CMake) and how can define dependencies (similar to ‘add_subdirectory’) for dependency discovery.