mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-09 20:26:09 -04:00
Merge pull request #380 [Meson] fixes for meson project from ninjaoflight/windows-support
This commit is contained in:
commit
4fc2eeecf0
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,6 +3,8 @@ Release
|
|||||||
build
|
build
|
||||||
*.a
|
*.a
|
||||||
|
|
||||||
|
# ignore clangd cache directory
|
||||||
|
.cache
|
||||||
.vs/
|
.vs/
|
||||||
.vscode/
|
.vscode/
|
||||||
/SQLiteCpp.sln
|
/SQLiteCpp.sln
|
||||||
@ -17,6 +19,8 @@ core
|
|||||||
*ipch
|
*ipch
|
||||||
.settings/
|
.settings/
|
||||||
|
|
||||||
|
# do not track Visual Studio CMake settings
|
||||||
|
CMakeSettings.json
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
*.dir
|
*.dir
|
||||||
|
99
meson.build
99
meson.build
@ -3,7 +3,7 @@ project(
|
|||||||
# SQLiteCpp requires C++11 support
|
# SQLiteCpp requires C++11 support
|
||||||
default_options: ['cpp_std=c++11'],
|
default_options: ['cpp_std=c++11'],
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
version: '3.1.1',
|
version: '3.2.0',
|
||||||
)
|
)
|
||||||
|
|
||||||
cxx = meson.get_compiler('cpp')
|
cxx = meson.get_compiler('cpp')
|
||||||
@ -35,6 +35,7 @@ sqlitecpp_srcs = [
|
|||||||
'src/Column.cpp',
|
'src/Column.cpp',
|
||||||
'src/Database.cpp',
|
'src/Database.cpp',
|
||||||
'src/Exception.cpp',
|
'src/Exception.cpp',
|
||||||
|
'src/Savepoint.cpp',
|
||||||
'src/Statement.cpp',
|
'src/Statement.cpp',
|
||||||
'src/Transaction.cpp',
|
'src/Transaction.cpp',
|
||||||
]
|
]
|
||||||
@ -54,6 +55,7 @@ sqlitecpp_opts = []
|
|||||||
sqlitecpp_test_srcs = [
|
sqlitecpp_test_srcs = [
|
||||||
'tests/Column_test.cpp',
|
'tests/Column_test.cpp',
|
||||||
'tests/Database_test.cpp',
|
'tests/Database_test.cpp',
|
||||||
|
'tests/Savepoint_test.cpp',
|
||||||
'tests/Statement_test.cpp',
|
'tests/Statement_test.cpp',
|
||||||
'tests/Backup_test.cpp',
|
'tests/Backup_test.cpp',
|
||||||
'tests/Transaction_test.cpp',
|
'tests/Transaction_test.cpp',
|
||||||
@ -61,16 +63,16 @@ sqlitecpp_test_srcs = [
|
|||||||
'tests/Exception_test.cpp',
|
'tests/Exception_test.cpp',
|
||||||
'tests/ExecuteMany_test.cpp',
|
'tests/ExecuteMany_test.cpp',
|
||||||
]
|
]
|
||||||
sqlitecpp_test_args = [
|
sqlitecpp_test_args = []
|
||||||
# do not use ambiguous overloads by default
|
|
||||||
'-DNON_AMBIGOUS_OVERLOAD'
|
|
||||||
]
|
|
||||||
|
|
||||||
## samples
|
## samples
|
||||||
|
|
||||||
sqlitecpp_sample_srcs = [
|
sqlitecpp_sample1_srcs = [
|
||||||
'examples/example1/main.cpp',
|
'examples/example1/main.cpp',
|
||||||
]
|
]
|
||||||
|
sqlitecpp_sample2_srcs = [
|
||||||
|
'examples/example2/src/main.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
# if not using MSVC we need to add this compiler arguments
|
# if not using MSVC we need to add this compiler arguments
|
||||||
# for a list of MSVC supported arguments please check:
|
# for a list of MSVC supported arguments please check:
|
||||||
@ -91,6 +93,11 @@ if host_machine.system() == 'windows'
|
|||||||
sqlitecpp_opts += [
|
sqlitecpp_opts += [
|
||||||
'cpp_std=c++14',
|
'cpp_std=c++14',
|
||||||
]
|
]
|
||||||
|
# check that we are not trying to build as dynamic library
|
||||||
|
if get_option('default_library') != 'shared'
|
||||||
|
warming('SQLiteCpp does not support shared library on Windows, the library will be built as static')
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
# Options relative to SQLite and SQLiteC++ functions
|
# Options relative to SQLite and SQLiteC++ functions
|
||||||
|
|
||||||
@ -137,43 +144,50 @@ if get_option('b_coverage')
|
|||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
## Workarround for windows: if building on windows we will build the library as static
|
||||||
libsqlitecpp = library(
|
if host_machine.system() == 'windows'
|
||||||
'sqlitecpp',
|
libsqlitecpp = static_library(
|
||||||
sqlitecpp_srcs,
|
'sqlitecpp',
|
||||||
include_directories: sqlitecpp_incl,
|
|
||||||
cpp_args: sqlitecpp_args,
|
|
||||||
dependencies: sqlitecpp_deps,
|
|
||||||
# override the default options
|
|
||||||
override_options: sqlitecpp_opts,
|
|
||||||
# install: true,
|
|
||||||
# API version for SQLiteCpp shared library.
|
|
||||||
version: '0',)
|
|
||||||
if get_option('SQLITECPP_BUILD_TESTS')
|
|
||||||
# for the unit tests we need to link against a static version of SQLiteCpp
|
|
||||||
libsqlitecpp_static = static_library(
|
|
||||||
'sqlitecpp_static',
|
|
||||||
sqlitecpp_srcs,
|
sqlitecpp_srcs,
|
||||||
include_directories: sqlitecpp_incl,
|
include_directories: sqlitecpp_incl,
|
||||||
cpp_args: sqlitecpp_args,
|
cpp_args: sqlitecpp_args,
|
||||||
dependencies: sqlitecpp_deps,
|
dependencies: sqlitecpp_deps,
|
||||||
# override the default options
|
# override the default options
|
||||||
override_options: sqlitecpp_opts,)
|
override_options: sqlitecpp_opts,)
|
||||||
# static libraries do not have a version
|
else
|
||||||
|
libsqlitecpp = library(
|
||||||
|
'sqlitecpp',
|
||||||
|
sqlitecpp_srcs,
|
||||||
|
include_directories: sqlitecpp_incl,
|
||||||
|
cpp_args: sqlitecpp_args,
|
||||||
|
dependencies: sqlitecpp_deps,
|
||||||
|
# override the default options
|
||||||
|
override_options: sqlitecpp_opts,
|
||||||
|
# install: true,
|
||||||
|
# API version for SQLiteCpp shared library.
|
||||||
|
version: '0',)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install_headers(
|
if get_option('SQLITECPP_BUILD_TESTS')
|
||||||
'include/SQLiteCpp/SQLiteCpp.h',
|
# for the unit tests we need to link against a static version of SQLiteCpp
|
||||||
'include/SQLiteCpp/Assertion.h',
|
if host_machine.system() == 'windows' or get_option('default_library') == 'static'
|
||||||
'include/SQLiteCpp/Backup.h',
|
# we do not need to recomplile the library
|
||||||
'include/SQLiteCpp/Column.h',
|
libsqlitecpp_static = libsqlitecpp
|
||||||
'include/SQLiteCpp/Database.h',
|
else
|
||||||
'include/SQLiteCpp/Exception.h',
|
libsqlitecpp_static = static_library(
|
||||||
'include/SQLiteCpp/Statement.h',
|
'sqlitecpp_static',
|
||||||
'include/SQLiteCpp/Transaction.h',
|
sqlitecpp_srcs,
|
||||||
'include/SQLiteCpp/VariadicBind.h',
|
include_directories: sqlitecpp_incl,
|
||||||
'include/SQLiteCpp/ExecuteMany.h',
|
cpp_args: sqlitecpp_args,
|
||||||
)
|
dependencies: sqlitecpp_deps,
|
||||||
|
# override the default options
|
||||||
|
override_options: sqlitecpp_opts,)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
install_subdir(
|
||||||
|
'include/SQliteCpp',
|
||||||
|
install_dir: get_option('includedir'))
|
||||||
|
|
||||||
sqlitecpp_dep = declare_dependency(
|
sqlitecpp_dep = declare_dependency(
|
||||||
include_directories: sqlitecpp_incl,
|
include_directories: sqlitecpp_incl,
|
||||||
@ -192,7 +206,7 @@ if get_option('SQLITECPP_BUILD_TESTS')
|
|||||||
gtest_dep = dependency(
|
gtest_dep = dependency(
|
||||||
'gtest',
|
'gtest',
|
||||||
main : true,
|
main : true,
|
||||||
fallback: ['gtest', 'gtest_dep'])
|
fallback: ['gtest', 'gtest_main_dep'])
|
||||||
sqlitecpp_test_dependencies = [
|
sqlitecpp_test_dependencies = [
|
||||||
gtest_dep,
|
gtest_dep,
|
||||||
sqlitecpp_static_dep,
|
sqlitecpp_static_dep,
|
||||||
@ -210,12 +224,19 @@ if get_option('SQLITECPP_BUILD_TESTS')
|
|||||||
test('sqlitecpp unit tests', testexe, args: test_args)
|
test('sqlitecpp unit tests', testexe, args: test_args)
|
||||||
endif
|
endif
|
||||||
if get_option('SQLITECPP_BUILD_EXAMPLES')
|
if get_option('SQLITECPP_BUILD_EXAMPLES')
|
||||||
## demo executable
|
## demo 1 executable
|
||||||
sqlitecpp_demo_exe = executable('SQLITECPP_sample_demo',
|
sqlitecpp_demo1_exe = executable('SQLITECPP_sample_demo1',
|
||||||
sqlitecpp_sample_srcs,
|
sqlitecpp_sample1_srcs,
|
||||||
dependencies: sqlitecpp_dep,
|
dependencies: sqlitecpp_dep,
|
||||||
# override the default options
|
# override the default options
|
||||||
override_options: sqlitecpp_opts,)
|
override_options: sqlitecpp_opts,)
|
||||||
|
## demo 2 executable
|
||||||
|
sqlitecpp_demo1_exe = executable('SQLITECPP_sample_demo2',
|
||||||
|
sqlitecpp_sample2_srcs,
|
||||||
|
dependencies: sqlitecpp_dep,
|
||||||
|
# override the default options
|
||||||
|
override_options: sqlitecpp_opts,)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
@ -9,5 +9,7 @@ option('SQLITE_ENABLE_ASSERT_HANDLER', type: 'boolean', value: false, descriptio
|
|||||||
option('SQLITE_HAS_CODEC', type: 'boolean', value: false, description: 'Enable database encryption API. Not available in the public release of SQLite.')
|
option('SQLITE_HAS_CODEC', type: 'boolean', value: false, description: 'Enable database encryption API. Not available in the public release of SQLite.')
|
||||||
## Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
|
## Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
|
||||||
option('SQLITE_USE_LEGACY_STRUCT', type: 'boolean', value: false, description: 'Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)')
|
option('SQLITE_USE_LEGACY_STRUCT', type: 'boolean', value: false, description: 'Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)')
|
||||||
|
## Enable build for the tests of SQLiteC++
|
||||||
option('SQLITECPP_BUILD_TESTS', type: 'boolean', value: false, description: 'Build SQLiteC++ unit tests.')
|
option('SQLITECPP_BUILD_TESTS', type: 'boolean', value: false, description: 'Build SQLiteC++ unit tests.')
|
||||||
|
## Build the examples of SQLiteC++
|
||||||
option('SQLITECPP_BUILD_EXAMPLES', type: 'boolean', value: false, description: 'Build SQLiteC++ examples.')
|
option('SQLITECPP_BUILD_EXAMPLES', type: 'boolean', value: false, description: 'Build SQLiteC++ examples.')
|
@ -1,9 +1,12 @@
|
|||||||
[wrap-file]
|
[wrap-file]
|
||||||
directory = googletest-release-1.11.0
|
directory = googletest-release-1.12.1
|
||||||
source_url = https://github.com/google/googletest/archive/release-1.11.0.tar.gz
|
source_url = https://github.com/google/googletest/archive/release-1.12.1.tar.gz
|
||||||
source_filename = gtest-1.11.0.tar.gz
|
source_filename = gtest-1.12.1.tar.gz
|
||||||
source_hash = b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5
|
source_hash = 81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2
|
||||||
patch_directory = gtest
|
patch_filename = gtest_1.12.1-1_patch.zip
|
||||||
|
patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.12.1-1/get_patch
|
||||||
|
patch_hash = 75143f11e174952bc768699fde3176511fe8e33b25dc6f6347d89e41648e99cf
|
||||||
|
wrapdb_version = 1.12.1-1
|
||||||
|
|
||||||
[provide]
|
[provide]
|
||||||
gtest = gtest_dep
|
gtest = gtest_dep
|
||||||
|
Loading…
x
Reference in New Issue
Block a user