diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2021-01-20 15:21:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 15:21:00 +0100 |
commit | 94037f70b82300f9fda306485475fee067b97d02 (patch) | |
tree | bbb7538e29fee915f446d7b865e81e2cf34e5008 | |
parent | 9b94940251ac7cdb5c833c44fa069f978ac706ff (diff) | |
parent | e7d1113a2b254bc37b098f0cdda4c0908e20487f (diff) |
Merge pull request #2 from nico202/patch-2v0.0.1
meson: Use system doctest if available
-rw-r--r-- | blurhash.cpp | 4 | ||||
-rw-r--r-- | meson.build | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/blurhash.cpp b/blurhash.cpp index a4adf89f..b8c0eba4 100644 --- a/blurhash.cpp +++ b/blurhash.cpp @@ -11,7 +11,11 @@ #endif #ifdef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#if __has_include(<doctest.h>) #include <doctest.h> +#else +#include <doctest/doctest.h> +#endif #endif using namespace std::literals; diff --git a/meson.build b/meson.build index 6000a65a..152c4e7b 100644 --- a/meson.build +++ b/meson.build @@ -6,8 +6,8 @@ lib = static_library('blurhash', 'blurhash.cpp', install : true) -doctest_proj = subproject('doctest') -doctest_dep = doctest_proj.get_variable('doctest_dep') +doctest_dep = dependency('doctest', fallback : ['doctest', 'doctest_dep']) + tests = executable('blurhash-tests', 'blurhash.cpp', 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('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') |