mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-06 18:56:40 -04:00

When building with SQLITECPP_INTERNAL_SQLITE=ON the SQLite amalgamation source is used for generating the library. Using one big source file means all the library code will be put in a single section. When building statically linked executables the entire section will be linked even if a small portion of the library is actually used. This commit addresses this issue by setting the -ffunction-sections compiler option when building the library. As each function is placed in a section of its own the linker, when passed the --gc-sections, will throw away unused sections (functions) and reduce the executable size.
sqlite3
"sqlite3.c" and "sqlite3.h" files from sqlite-amalgamation-3300100.zip (SQLite 3.30.1 2019-10-10)
Those files are provided for easy setup and compatibility under Windows/Linux/MacOS. They are used by default by the CMake build.
Use -DSQLITECPP_INTERNAL_SQLITE=OFF to link against the Linux "libsqlite3-dev" package instead.
License:
All of the code and documentation in SQLite has been dedicated to the public domain by the authors.