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() #include +#else +#include +#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')