mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-09 20:26:09 -04:00
[Meson] build library as static on windows
as dynamic linking is not supported on windows we can give a warning and compile the library as static itself
This commit is contained in:
parent
b73d8446be
commit
bd2e1c6087
55
meson.build
55
meson.build
@ -93,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
|
||||||
|
|
||||||
@ -139,29 +144,45 @@ 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
|
||||||
|
|
||||||
|
if get_option('SQLITECPP_BUILD_TESTS')
|
||||||
|
# for the unit tests we need to link against a static version of SQLiteCpp
|
||||||
|
if host_machine.system() == 'windows' or get_option('default_library') == 'static'
|
||||||
|
# we do not need to recomplile the library
|
||||||
|
libsqlitecpp_static = libsqlitecpp
|
||||||
|
else
|
||||||
|
libsqlitecpp_static = static_library(
|
||||||
|
'sqlitecpp_static',
|
||||||
|
sqlitecpp_srcs,
|
||||||
|
include_directories: sqlitecpp_incl,
|
||||||
|
cpp_args: sqlitecpp_args,
|
||||||
|
dependencies: sqlitecpp_deps,
|
||||||
|
# override the default options
|
||||||
|
override_options: sqlitecpp_opts,)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install_subdir(
|
install_subdir(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user