libs: enable -fPIC for sqlite3

This commit is contained in:
Remy Marquis 2016-08-25 19:29:43 +02:00
parent 7311e4eefd
commit 1cc823c99c

View file

@ -58,6 +58,16 @@ else()
#set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ldl")
endif()
if(MINGW OR UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-attributes")
# this is required for bundled 64bit sqlite3 lib
# http://stackoverflow.com/questions/7216244/why-is-fpic-absolutely-necessary-on-64-and-not-on-32bit-platforms
if(NOT CROSS_COMPILE32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif(NOT CROSS_COMPILE32)
endif()
# add include path for project
include_directories(${SQLITE3_SOURCE_DIR}/src)