SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

(optionally) build internal sqlite3 library with -ffunction-sections

Open smichaku opened this issue 5 years ago • 2 comments

SQLiteCPP uses the SQLite amalgamation source when building with SQLITECPP_INTERNAL_SQLITE=ON. This puts all the library's code in a single section which is linked as a dependency with SQLiteCPP. Compiling the amalgamation source with -ffunction-sections will put each function in a section and allow the linker to throw away unused sections making the final binary size smaller.

smichaku avatar Aug 23 '20 07:08 smichaku

Hello,

Nice idea indeed! Would you be able to provide a pull request for it? It could actually even be the default if it make sense/doesn't have too many drawbacks.

SRombauts avatar Aug 23 '20 08:08 SRombauts

Pull request was submitted. I must say I did not get the chance to test this change thoroughly at my end yet... It does look harmless for my usage but it might be worthwhile to consider the impact in the general use case.

smichaku avatar Aug 23 '20 12:08 smichaku