orotool/subprojects/packagefiles/SQLiteCpp/meson.build

62 lines
1.6 KiB
Meson
Raw Normal View History

2020-06-23 08:58:19 +00:00
project('SQLiteCpp', 'cpp',
2020-08-27 23:04:31 +00:00
version: '3.1.1',
2020-06-23 08:58:19 +00:00
meson_version: '>=0.49.2',
2020-08-27 23:04:31 +00:00
default_options: ['cpp_std=c++11'],
2020-06-23 08:58:19 +00:00
)
2020-08-10 17:42:10 +00:00
sqlite_dep = dependency('sqlite3', version: '>=3.32.1')
2020-06-23 08:58:19 +00:00
2020-08-27 23:13:13 +00:00
pub_incdir = include_directories('include')
2020-06-23 08:58:19 +00:00
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
2020-06-23 08:58:19 +00:00
sqlitecpp_target = library(meson.project_name(),
2020-08-27 23:13:13 +00:00
'src/Backup.cpp',
'src/Column.cpp',
'src/Database.cpp',
'src/Exception.cpp',
'src/Statement.cpp',
'src/Transaction.cpp',
2020-08-28 00:35:07 +00:00
install: (not meson.is_subproject() or get_option('default_library')=='shared'),
2020-06-23 08:58:19 +00:00
include_directories: [pub_incdir],
dependencies: [sqlite_dep],
c_args: compiler_opts,
cpp_args: compiler_opts,
2020-06-23 08:58:19 +00:00
)
sqlitecpp_dep = declare_dependency(
link_with: sqlitecpp_target,
include_directories: pub_incdir,
compile_args: compiler_opts,
2020-08-27 23:13:13 +00:00
dependencies: sqlite_dep.partial_dependency(includes: true),
)
2020-08-28 00:35:07 +00:00
if not meson.is_subproject()
install_headers(
'include/SQLiteCpp/Assertion.h',
'include/SQLiteCpp/Backup.h',
'include/SQLiteCpp/Column.h',
'include/SQLiteCpp/Database.h',
'include/SQLiteCpp/Exception.h',
'include/SQLiteCpp/ExecuteMany.h',
'include/SQLiteCpp/SQLiteCpp.h',
'include/SQLiteCpp/Statement.h',
'include/SQLiteCpp/Transaction.h',
'include/SQLiteCpp/Utils.h',
'include/SQLiteCpp/VariadicBind.h',
subdir: meson.project_name(),
)
endif