mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 04:28:49 +03:00
Merge pull request #2 from nico202/patch-2
meson: Use system doctest if available
This commit is contained in:
commit
94037f70b8
2 changed files with 16 additions and 2 deletions
|
@ -11,7 +11,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
#ifdef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||||
|
#if __has_include(<doctest.h>)
|
||||||
#include <doctest.h>
|
#include <doctest.h>
|
||||||
|
#else
|
||||||
|
#include <doctest/doctest.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
14
meson.build
14
meson.build
|
@ -6,8 +6,8 @@ lib = static_library('blurhash',
|
||||||
'blurhash.cpp',
|
'blurhash.cpp',
|
||||||
install : true)
|
install : true)
|
||||||
|
|
||||||
doctest_proj = subproject('doctest')
|
doctest_dep = dependency('doctest', fallback : ['doctest', 'doctest_dep'])
|
||||||
doctest_dep = doctest_proj.get_variable('doctest_dep')
|
|
||||||
tests = executable('blurhash-tests',
|
tests = executable('blurhash-tests',
|
||||||
'blurhash.cpp',
|
'blurhash.cpp',
|
||||||
cpp_args : '-DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN',
|
cpp_args : '-DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN',
|
||||||
|
@ -17,3 +17,13 @@ test('blurhash-tests', tests)
|
||||||
|
|
||||||
executable('blurhash2bmp', 'blurhash2bmp.cpp', link_with: lib, install: true)
|
executable('blurhash2bmp', 'blurhash2bmp.cpp', link_with: lib, install: true)
|
||||||
executable('blurhash', 'image2blurhash.cpp', link_with: lib, install: true)
|
executable('blurhash', 'image2blurhash.cpp', link_with: lib, install: true)
|
||||||
|
|
||||||
|
install_headers('blurhash.hpp')
|
||||||
|
|
||||||
|
pkg = import('pkgconfig')
|
||||||
|
pkg.generate(libraries : [lib],
|
||||||
|
subdirs : ['.'],
|
||||||
|
version : meson.project_version(),
|
||||||
|
name : meson.project_name(),
|
||||||
|
filebase : meson.project_name(),
|
||||||
|
description : 'C++ blurhash encoder/decoder')
|
||||||
|
|
Loading…
Reference in a new issue