* ci: pass --build-config to ctest
It's required when using multi-config generators like MSVC on Windows
* Do not download git-lfs files by default
The test file is really big, and downloading it by default may create
issues with users on a slow network.
Use a .lfsconfig file to disable LFS downloads. This way, LFS files can
be explicitly downloaded via
git lfs pull --exclude='' --include='*'
* build: use Git LFS test data
* ci: enable test assets and cache them
* ci: limit runs to the master branch
This avoids duplicated runs on merge requests
* Move ownership of DSP memory to user
Co-Authored-By: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
* Allow SharedMemory to be owned by either the user or Teakra, fix tests
* Fix C bindings
* Address comments
---------
Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
The `BUILD_TESTING` option is the standard CMake option used to disable
tests.
With this patch, tests will only be built when `BUILD_TESTING` isn't
`OFF`.
In other words, defining `BUILD_TESTING=OFF` will disable tests,
regardless of the value of `MASTER_PROJECT` and
`TEAKRA_BUILD_UNIT_TESTS`. It ovverides them.
When the user does not explicitly define `BUILD_TESTING=OFF`, the build
will behave as before.
The `BUILD_TESTING` option is defined by the built-in `CTest` module.
Including the module also automatically calls `enable_testing()`, so
calling it explicitly isn't required anymore.
Honouring this option is especially nice for downstream distributions
like Debian, as our build systems automatically define
`BUILD_TESTING=OFF` when appropriate.
This allows system-wide installation, useful for distribution packagers.
The minimum required CMake version is bumped to 3.14, as the `TYPE`
argument of `install(DIRECTORY)` requires it. This also has the benefit
of fixing the CMake 3.10 deprecation warning.
Recent versions of GCC started throwing a no-ignored-attributes warning
for code using `std::unique_ptr<std::FILE, decltype(std::fclose)>`,
since some attribute set on fclose gets discarded.
To fix the issue, I've added a simple fclose_deleter callable which
calls fclose. It also simplifies code as it is no longer needed to pass
`std::fclose` as an argument when constructing the unique_ptr. Also,
according to <https://stackoverflow.com/a/76867913/10767647>, this is
"better practice".
Even though the code that uses the Teakra API can call the AHBM memory
access callbacks itself directly, AHBM also does some weird stuff on
misaligned accesses, for which these functions are probably useful.