Closed McNopper closed 7 years ago
Lodepng is already easily included in projects as a single source file plus header, without being a separate library. Does that help for this use case?
It would be much more convenient, if it would be just header only like GLI or GLM is.
See, sometimes I need to build for WIndows, Linux (Desktop and embedded), Android (all platforms), Integrity and QNX. Then, you also have 32 / 64 bit and so on. So, as soon as a new release comes out, all these libs need to be built.
When using GLI or GLM, you just include the header and that's it. Would be just great, if this would be possible somehow with lodepng as well.
It's not too hard to write a script which fetches the latest version and creates a header-only by taking lodepng.h and appending lodepng.cpp to it (except the #include "lodepng.h" line)
In addition, the script would have to make all functions static or inline.
Would that work? Or #including the .cpp file and placing an anonymous namespace around it?
I need to try it out, if this works out.
In addition, the script would have to make all functions static or inline.
Hmm, only if it's included from multiple files I think. Else it will just work.
Oh, I made some further research. I found a repo, which provides a header only solution: https://github.com/nothings/stb
It would be great, if a header only version does exist or could easily be created.
When doing a lot of cross platform development, a header only version avoids maintaining and building the libraries for new versions.