From ca45c678842d7ceab5186df47c47f9a7b7de815d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Sun, 3 Mar 2019 00:18:00 +0100 Subject: [PATCH] Fix #167 sqlite3 library cannot be built on Linux when dynamically linked --- sqlite3/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 57deb56c..1a2698c5 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -10,3 +10,7 @@ add_library(sqlite3 sqlite3.c sqlite3.h ) + +if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) + set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC") +endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))