diff --git a/blurhash.cpp b/blurhash.cpp index a4adf89f..c17802ac 100644 --- a/blurhash.cpp +++ b/blurhash.cpp @@ -11,7 +11,7 @@ #endif #ifdef DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN -#include +#include #endif using namespace std::literals; diff --git a/meson.build b/meson.build index 6000a65a..8cefcecd 100644 --- a/meson.build +++ b/meson.build @@ -6,8 +6,13 @@ lib = static_library('blurhash', 'blurhash.cpp', install : true) -doctest_proj = subproject('doctest') -doctest_dep = doctest_proj.get_variable('doctest_dep') +doctest_dep = dependency('doctest', required : false) + +if not doctest_dep.found() + doctest_proj = subproject('doctest') + doctest_dep = doctest_proj.get_variable('doctest_dep') +endif + tests = executable('blurhash-tests', 'blurhash.cpp', cpp_args : '-DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN',