diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 7ee9df3..c4a4785 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -35,6 +35,11 @@ endif (SQLITE_ENABLE_RTREE) if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) set_target_properties(sqlite3 PROPERTIES COMPILE_FLAGS "-fPIC") + + # Put each function in its own section to allow the linker garbage + # collection to remove unused section and produced a smaller + # statically-lined executables. + target_compile_options(sqlite3 PRIVATE "-ffunction-sections") endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) if (UNIX AND CMAKE_COMPILER_IS_GNUCXX)