1
0
cuberite-2a/lib/sqlite/CMakeLists.txt
linnemannr 5049fd0fbf Support building on FreeBSD
SetFlags.cmake

	Add -lexecinfo to linker flags for FreeBSD to resolve backtrace()

lib/sqlite/CMakeLists.txt

	Define _XOPEN_SOURCE to 600 instead of __POSIX_VISIBLE to 200112 for
	POSIX 1-2001 support. For POSIX standards, the _XOPEN_SOURCE define
	controls the eventual value of __POSIX_VISIBLE. _XOPEN_SOURCE is defined
	to 500 in sqlite.c if not already defined, which sets up _POSIX_C_SOURCE
	and __POSIX_VISIBLE to the 199506 for POSIX.1c

lib/tolua++/CMakeLists.txt
src/CMakeLists.txt

	Add /usr/local/lib to the library search path for FreeBSD builds

src/OSSupport/Errors.cpp

	Correct the strerror_r() implementation determination to check whether
	_GNU_SOURCE is defined, not what it evaluates to
2015-05-24 20:07:31 -06:00

37 lines
782 B
CMake

cmake_minimum_required (VERSION 2.6)
project (sqlite)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.c"
)
# 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})
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")
endif()
add_library(sqlite ${SOURCE})
target_link_libraries(sqlite lua)
if (UNIX)
target_link_libraries(sqlite ${DYNAMIC_LOADER})
endif()