Add some cmake options to the meson file

This commit is contained in:
King_DuckZ 2020-06-23 15:14:57 +02:00
parent e94131ac32
commit e3b8b563f0
2 changed files with 44 additions and 0 deletions

View file

@ -8,6 +8,20 @@ sqlite_dep = dependency('sqlite3', version: '>=3.7.15')
pub_incdir = include_directories('SQLiteCpp/include')
compiler_opts = []
if get_option('sqlite_enable_column_metadata')
compiler_opts += ['-DSQLITE_ENABLE_COLUMN_METADATA']
endif
if get_option('sqlite_enable_assert_handler')
compiler_opts += ['SQLITECPP_ENABLE_ASSERT_HANDLER']
endif
if get_option('sqlite_has_codec')
compiler_opts += ['SQLITE_HAS_CODEC']
endif
if get_option('sqlite_use_legacy_struct')
compiler_opts += ['SQLITE_USE_LEGACY_STRUCT']
endif
sqlitecpp_target = library(meson.project_name(),
'SQLiteCpp/src/Backup.cpp',
'SQLiteCpp/src/Column.cpp',
@ -18,9 +32,12 @@ sqlitecpp_target = library(meson.project_name(),
install: true,
include_directories: [pub_incdir],
dependencies: [sqlite_dep],
c_args: compiler_opts,
cpp_args: compiler_opts,
)
sqlitecpp_dep = declare_dependency(
link_with: sqlitecpp_target,
include_directories: pub_incdir,
compile_args: compiler_opts,
)

View file

@ -0,0 +1,27 @@
option(
'sqlite_enable_column_metadata',
type: 'boolean',
value: true,
description: 'Enable Column::getColumnOriginName(). Require support from sqlite3 library.'
)
option(
'sqlite_enable_assert_handler',
value: false,
type: 'boolean',
description: 'Enable the user definition of a assertion_failed() handler.'
)
option(
'sqlite_has_codec',
value: false,
type: 'boolean',
description: 'Enable database encryption API. Not available in the public release of SQLite.'
)
option(
'sqlite_use_legacy_struct',
value: false,
type: 'boolean',
description: 'Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)'
)