From 65e8d91c4269a6a53c94468b794a0edc32a69e5d Mon Sep 17 00:00:00 2001 From: Peter Bell Date: Thu, 7 May 2020 23:13:06 +0100 Subject: [PATCH] Remove sqlite in favour of SQLiteCpp vendored version --- CMakeLists.txt | 32 +++++++------------------------- lsqlite3.c | 4 ++-- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 077ae9a..23d58bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,37 +1,19 @@ -project (lsqlite) - -include_directories ( - "${PROJECT_SOURCE_DIR}/../SQLiteCpp/sqlite3" - "${PROJECT_SOURCE_DIR}/.." -) - -file(GLOB SOURCE - "*.c" -) +cmake_minimum_required (VERSION 3.13) +project (lsqlite C) +add_library(lsqlite lsqlite3.c) +target_link_libraries(lsqlite PUBLIC sqlite3 lua) # Lua is required as a DLL for LuaSQLite: if (WIN32) - add_definitions(-DLUA_BUILD_AS_DLL) -endif() - - -# add headers to MSVC project files: -if (MSVC) - file(GLOB HEADERS "src/*.h") - list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/src/lua.h" "${PROJECT_SOURCE_DIR}/src/luac.h") - set(SOURCE ${SOURCE} ${HEADERS}) - source_group("Sources" FILES ${SOURCE}) + target_compile_definitions(lsqlite PRIVATE LUA_BUILD_AS_DLL) endif() # FreeBSD requires us to define this to get POSIX 2001 standard if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") - add_flags_cxx("-D_XOPEN_SOURCE=600") + target_compile_definitions(lsqlite PRIVATE _XOPEN_SOURCE=600) endif() -add_library(lsqlite ${SOURCE}) -target_link_libraries(lsqlite lua) - if (UNIX) - target_link_libraries(lsqlite ${DYNAMIC_LOADER}) + target_link_libraries(lsqlite PRIVATE ${DYNAMIC_LOADER}) endif() diff --git a/lsqlite3.c b/lsqlite3.c index cf2c625..4c81b58 100644 --- a/lsqlite3.c +++ b/lsqlite3.c @@ -44,8 +44,8 @@ extern "C" { #include #define LUA_LIB -#include "lua/src/lua.h" -#include "lua/src/lauxlib.h" +#include "lua.h" +#include "lauxlib.h" #if LUA_VERSION_NUM > 501 //