mirror of
https://github.com/cuberite/sqlite.git
synced 2025-08-04 10:26:04 -04:00
Merge pull request #2 from cuberite/lsqlite-only2
Merge lsqlite-only branch into master
This commit is contained in:
commit
01cbf6d5a5
@ -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()
|
||||
|
@ -44,8 +44,8 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
|
||||
#define LUA_LIB
|
||||
#include "lua/src/lua.h"
|
||||
#include "lua/src/lauxlib.h"
|
||||
#include "lua.h"
|
||||
#include "lauxlib.h"
|
||||
|
||||
#if LUA_VERSION_NUM > 501
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user