Windows improved support (meson) by UnixY2K · Pull Request #354 · SRombauts/SQLiteCpp (original) (raw)
this PR is an improvement of #352, managing to compile statically and run unit tests successfully on windows.
a summary of the changes in this PR:
- Meson file
- use c++14 on windows(due to an error with xstddef)
- add a preprocessor definition ('NON_AMBIGOUS_OVERLOAD') to use int instead of long to prevent ambiguous overload when compiling with clang++, it does not affect cmake and it only is enabled on meson
- Unit tests
- tests/Statement_test.cpp -> use "int64_t"(supported on c++11) instead of "long long" to prevent ambiguous overload errors (tested both on Arch Linux & Windows w clang)
- tests/Statement_test.cpp -> check if NON_AMBIGOUS_OVERLOAD is defined and use int instead of long if is the case (to prevent ambiguous overload on windows)
the library still does not compile dynamically (as windows does not export the functions by default), so that should be fixed on an 3rd PR potentially fixing #280 and #53 for both meson and cmake, but this is a start before working on adding a macro for that feature.
after the dynamic compilation on windows is fixed, we could put the package on wrapdb so more users can use it easily.