From 4b4bc3f17a0440a448c826de8dbc8ed470c1850e Mon Sep 17 00:00:00 2001 From: Ashley Williams Date: Mon, 29 Aug 2016 18:50:28 +0100 Subject: [PATCH 1/2] Link libssp when targetted --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5044161..e8917bd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,6 +162,9 @@ include_directories("${PROJECT_SOURCE_DIR}/include") # add sources of the wrapper as a "SQLiteCpp" static library add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT}) target_include_directories(SQLiteCpp PUBLIC "${PROJECT_SOURCE_DIR}/include") +if (NOT MSVC) + target_link_libraries(SQLiteCpp libssp) +endif (NOT MSVC) if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC") From acbad052575ff5ac7fbfc21c9cc306be1508c3f5 Mon Sep 17 00:00:00 2001 From: Ashley Williams Date: Tue, 30 Aug 2016 20:03:41 +0100 Subject: [PATCH 2/2] Revert linking ssp in SQLiteCpp and link ssp in the example project for MSYS and MINGW --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8917bd1..129b8198 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,9 +162,6 @@ include_directories("${PROJECT_SOURCE_DIR}/include") # add sources of the wrapper as a "SQLiteCpp" static library add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT}) target_include_directories(SQLiteCpp PUBLIC "${PROJECT_SOURCE_DIR}/include") -if (NOT MSVC) - target_link_libraries(SQLiteCpp libssp) -endif (NOT MSVC) if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")) set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC") @@ -242,6 +239,8 @@ if (SQLITECPP_BUILD_EXAMPLES) if (NOT APPLE) target_link_libraries(SQLiteCpp_example1 dl) endif () + elseif (MSYS OR MINGW) + target_link_libraries(SQLiteCpp_example1 ssp) endif () else (SQLITECPP_BUILD_EXAMPLES) message(STATUS "SQLITECPP_BUILD_EXAMPLES OFF")