If a Meson option is typed as `boolean`, the `get_option` returns a
boolean, and comparing it with `true` is redundant. Meson also errors if
you try to compare across types, so it couldn't _not_ be a boolean.
Also, Meson is not C, so no need for parentheses around `if` conditions.
Rule of thumb on Windows:
* for a DLL:
* if the library is built, set TVG_API to __declspec(dllexport)
* if the library is used, set TVG_API to __declspec(dllimport)
* for a static library, set TVG_API to nothing
To set TVG_API for a static library, TVG_STATIC is defined when the stataic library is built.
Otherwise, TVG_API is correctly set for a DLL.
Also sun and intel compilers are handled
@issue: https://github.com/thorvg/thorvg/issues/1446
The previous meson script was incomplete,
therefore this change requires it to be revised.
To enable static linking use the next meson option.
"-Ddefault_library=static"
Issue: https://github.com/thorvg/thorvg/issues/1234
Catch2 is a multi-paradigm test framework for C++.
It is primarily distributed as a single header file,
very easy and simple to adopt this to thorvg project.
This patch introduces catch2 infrastsructure and one prototype as a sample.
You can refer "testInitializer.cpp", how to add unit test!
while ignoring else files such as "catch2.hpp", "testMain.cpp"
Also, enable Unit-tests with meson option when you change any thorvg code.
$meson build -Dtests=true.
launch tvgUnitTest in the build result then verify 100% coverage
before submitting any patches.