mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-05 02:06:02 -04:00
Re-enable SQLITE_ENABLE_COLUMN_METADATA by default under Windows
- cleanup to the CMakeLists.txt for better readability
This commit is contained in:
parent
416958f094
commit
b10bf6faa5
@ -1,47 +1,27 @@
|
|||||||
if (BIICODE)
|
|
||||||
|
|
||||||
# biicode doesn't process files bigger than 5Mb
|
|
||||||
list(APPEND BII_LIB_SRC sqlite3/sqlite3.c)
|
|
||||||
# Include base block dir
|
|
||||||
ADD_BIICODE_TARGETS()
|
|
||||||
|
|
||||||
# Link target with dl for linux
|
|
||||||
if (UNIX)
|
|
||||||
TARGET_LINK_LIBRARIES(${BII_BLOCK_TARGET} INTERFACE pthread)
|
|
||||||
if(NOT APPLE)
|
|
||||||
TARGET_LINK_LIBRARIES(${BII_BLOCK_TARGET} INTERFACE dl)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else (BIICODE)
|
|
||||||
|
|
||||||
# Main CMake file for compiling the library itself, examples and tests.
|
# Main CMake file for compiling the library itself, examples and tests.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
# Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
|
||||||
#
|
#
|
||||||
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
|
||||||
# or copy at http://opensource.org/licenses/MIT)
|
# or copy at http://opensource.org/licenses/MIT)
|
||||||
|
if (NOT BIICODE)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
project(SQLiteCpp)
|
project(SQLiteCpp)
|
||||||
|
|
||||||
option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getName(). Require support from sqlite3 library." OFF)
|
|
||||||
if (SQLITE_ENABLE_COLUMN_METADATA)
|
|
||||||
# Enable the use of SQLite column metadata and Column::getName() method,
|
|
||||||
# Require that the sqlite3 library is also compiled with this flag (default under Debian/Ubuntu, but not on Mac OS X).
|
|
||||||
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
|
|
||||||
endif (SQLITE_ENABLE_COLUMN_METADATA)
|
|
||||||
|
|
||||||
option(SQLITE_ENABLE_ASSERT_HANDLER "Enable the user defintion of a assertion_failed() handler." OFF)
|
|
||||||
if (SQLITE_ENABLE_ASSERT_HANDLER)
|
|
||||||
# Enable the user defintion of a assertion_failed() handler (default to false, easier to handler for begginers).
|
|
||||||
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
|
|
||||||
endif (SQLITE_ENABLE_ASSERT_HANDLER)
|
|
||||||
|
|
||||||
# Define useful variables to handle OS differences:
|
# Define useful variables to handle OS differences:
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(DEV_NULL "NUL")
|
set(DEV_NULL "NUL")
|
||||||
|
# build the SQLite3 C library for Windows (for ease of use)
|
||||||
|
set(SQLITECPP_INTERNAL_SQLITE_DEFAULT ON)
|
||||||
|
set(SQLITE_ENABLE_COLUMN_METADATA_DEFAULT OFF)
|
||||||
else (WIN32)
|
else (WIN32)
|
||||||
set(DEV_NULL "/dev/null")
|
set(DEV_NULL "/dev/null")
|
||||||
|
# do not build the SQLite3 C library, but uses the Linux/Mac OS X sqlite3-dev package
|
||||||
|
set(SQLITECPP_INTERNAL_SQLITE_DEFAULT OFF)
|
||||||
|
set(SQLITE_ENABLE_COLUMN_METADATA_DEFAULT ON)
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
# then Compiler/IDE differences:
|
# then Compiler/IDE differences:
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(CPPLINT_ARG_OUTPUT "--output=vs7")
|
set(CPPLINT_ARG_OUTPUT "--output=vs7")
|
||||||
@ -69,6 +49,22 @@ set(CPPLINT_ARG_VERBOSE "--verbose=3")
|
|||||||
set(CPPLINT_ARG_LINELENGTH "--linelength=120")
|
set(CPPLINT_ARG_LINELENGTH "--linelength=120")
|
||||||
|
|
||||||
|
|
||||||
|
# Options relative to SQLite and SQLiteC++ functions
|
||||||
|
|
||||||
|
option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getName(). Require support from sqlite3 library." ${SQLITE_ENABLE_COLUMN_METADATA_DEFAULT})
|
||||||
|
if (SQLITE_ENABLE_COLUMN_METADATA)
|
||||||
|
# Enable the use of SQLite column metadata and Column::getName() method,
|
||||||
|
# Require that the sqlite3 library is also compiled with this flag (default under Debian/Ubuntu, but not on Mac OS X).
|
||||||
|
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
|
||||||
|
endif (SQLITE_ENABLE_COLUMN_METADATA)
|
||||||
|
|
||||||
|
option(SQLITE_ENABLE_ASSERT_HANDLER "Enable the user defintion of a assertion_failed() handler." OFF)
|
||||||
|
if (SQLITE_ENABLE_ASSERT_HANDLER)
|
||||||
|
# Enable the user defintion of a assertion_failed() handler (default to false, easier to handler for begginers).
|
||||||
|
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
|
||||||
|
endif (SQLITE_ENABLE_ASSERT_HANDLER)
|
||||||
|
|
||||||
|
|
||||||
## Core source code ##
|
## Core source code ##
|
||||||
|
|
||||||
# adding a new file require explicittly modifing the CMakeLists.txt
|
# adding a new file require explicittly modifing the CMakeLists.txt
|
||||||
@ -141,16 +137,14 @@ if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Cla
|
|||||||
endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
|
endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
|
||||||
|
|
||||||
|
|
||||||
# SQLite3 library (Windows only)
|
# SQLite3 library (mostly usefull under Windows)
|
||||||
|
|
||||||
option (SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)
|
option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ${SQLITECPP_INTERNAL_SQLITE_DEFAULT})
|
||||||
if (WIN32)
|
|
||||||
if (SQLITECPP_INTERNAL_SQLITE)
|
if (SQLITECPP_INTERNAL_SQLITE)
|
||||||
# build the SQLite3 C library for Windows (for ease of use) versus Linux sqlite3-dev package
|
# build the SQLite3 C library for Windows (for ease of use) versus Linux sqlite3-dev package
|
||||||
add_subdirectory(sqlite3)
|
add_subdirectory(sqlite3)
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/sqlite3")
|
include_directories("${PROJECT_SOURCE_DIR}/sqlite3")
|
||||||
endif (SQLITECPP_INTERNAL_SQLITE)
|
endif (SQLITECPP_INTERNAL_SQLITE)
|
||||||
endif (WIN32)
|
|
||||||
|
|
||||||
|
|
||||||
# Optional additional targets:
|
# Optional additional targets:
|
||||||
@ -238,4 +232,20 @@ else (SQLITECPP_BUILD_TESTS)
|
|||||||
message(STATUS "SQLITECPP_BUILD_TESTS OFF")
|
message(STATUS "SQLITECPP_BUILD_TESTS OFF")
|
||||||
endif (SQLITECPP_BUILD_TESTS)
|
endif (SQLITECPP_BUILD_TESTS)
|
||||||
|
|
||||||
endif (BIICODE)
|
|
||||||
|
else (NOT BIICODE)
|
||||||
|
|
||||||
|
# biicode doesn't process files bigger than 5Mb
|
||||||
|
list(APPEND BII_LIB_SRC sqlite3/sqlite3.c)
|
||||||
|
# Include base block dir
|
||||||
|
ADD_BIICODE_TARGETS()
|
||||||
|
|
||||||
|
# Link target with dl for linux
|
||||||
|
if (UNIX)
|
||||||
|
target_link_libraries(${BII_BLOCK_TARGET} INTERFACE pthread)
|
||||||
|
if (NOT APPLE)
|
||||||
|
target_link_libraries(${BII_BLOCK_TARGET} INTERFACE dl)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
endif (NOT BIICODE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user