Coding a plugin using third party code directly in source?

I’m trying to make a plugin that leverages a third-party “library.” The problem with that is that the instructions of said library tell me to put its source in with my project’s. I can technically build a symbol-less DLL of it, but it does not output a corresponding .lib file with it, nor is there any __dllspec(dllexport) of any kind in the headers. So now my problem is if there’s a UBT directive to point to secondary source paths.PublicIncludePaths and PrivateIncludePaths are all I know about and they’re for header files. UBT’s API is not well documented and Github search only does engine-wide searches, which gives hundreds of results to go through.

You probably want to take a look in the Engine\Source\ThirdParty folder, as there’s lots of examples there about setting up a ThirdParty library.

Basically though you just create a new module that hosts a pre-compiled library (ModuleType.External), and then set-up the .Build.cs file for that module to include and link to the correct things, before referencing it as a dependency in your plugin .Build.cs file.

Alternatively, since the library says to do this, you can just put its code inside a sub-folder of your plugin source code and include it from there (or add it as an include sub-path using PrivateIncludePaths or PublicIncludePaths).

Hmm… Well, that’s good as far as header files go, but how will UBT be aware of the .cpp files of this library?

If the code is pre-compiled then you don’t need the cpp files.

If the code is just dropped in your module then the cpp files will be added to your module like all your other source code is.

Ah, sounds good. Thanks