DLL export/import using BUILD_SHARED_LIBS by pierre-aimi · Pull Request #406 · SRombauts/SQLiteCpp (original) (raw)

the meson.build would require the following changes:

Diff File

diff --git a/meson.build b/meson.build index e270d56..dba3c49 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,8 @@ sqlitecpp_deps = [ ] ## used to override the default sqlitecpp options like cpp standard sqlitecpp_opts = [] +## used to set required macros when using sqlitecpp +sqlitecpp_dep_args = [] ## tests @@ -97,11 +99,6 @@ if host_machine.system() == 'windows' sqlitecpp_opts += [ 'cpp_std=c++14', ] - # check that we are not trying to build as dynamic library - if get_option('default_library') != 'shared' - message('warning: SQLiteCpp does not support shared library on Windows, the library will be built as static') - endif

endif

Options relative to SQLite and SQLiteC++ functions

@@ -199,33 +196,36 @@ if get_option('b_coverage') ] endif

-## Workarround for windows: if building on windows we will build the library as static -if host_machine.system() == 'windows'

-else

+sqlitecpp_static_args = sqlitecpp_args +sqlitecpp_static_dep_args = sqlitecpp_dep_args +# if windows and shared library +if host_machine.system() == 'windows' and get_option('default_library') == 'shared'

endif

+libsqlitecpp = library(

@@ -247,13 +247,14 @@ install_subdir( sqlitecpp_dep = declare_dependency( include_directories: sqlitecpp_incl, link_with: libsqlitecpp,

) if get_option('SQLITECPP_BUILD_TESTS') ## make the dependency static so the unit tests can link against it

@@ -264,7 +265,7 @@ if get_option('SQLITECPP_BUILD_TESTS') fallback: ['gtest', 'gtest_main_dep']) sqlitecpp_test_dependencies = [ gtest_dep,

if required I can do the changes on another PR