I'm creating a GDScript wrapper library using tiny-dnn C++ library as base.
The issue is that tiny-dnn is header-only, and I have to include it in most of my library's .cpp files (after all, I'm creating a wrapper). This results in a compilation time of 1 minute/file and a binary of ~300MB.
As a "solution" I decided to put all my code (20 .cpp files) into a big file and include tiny-dnn just once. The compilation time rate stayed the same, but now I have only one file, and the binary size reduced to ~50MB. Based on this experiment, I guess that tiny-dnn is being copied over and over again as I include it.
I can continue my project using the "solution" above, but I'm still questioning: is there a way to keep the reduced binary size and the reduced compilation time, still have separate files and still use tiny-dnn?
By the way, I'm using Linux and compiling with g++, along with SCons.