Merge pull request #295 Compile internal SQLite library with -ffunction-sections from smichaku/smichaku/sqlite-function-sections

This commit is contained in:
Sébastien Rombauts 2021-01-06 10:53:43 +01:00 committed by GitHub
commit 9b6c0cf6ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,11 @@ endif (SQLITE_ENABLE_RTREE)
if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
set_target_properties(sqlite3 PROPERTIES COMPILE_FLAGS "-fPIC") 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")) endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
if (UNIX AND CMAKE_COMPILER_IS_GNUCXX) if (UNIX AND CMAKE_COMPILER_IS_GNUCXX)