-
Notifications
You must be signed in to change notification settings - Fork 4
/
meson.build
48 lines (39 loc) · 1.56 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
project('blurhash', 'cpp',
version : '0.2.0',
default_options : ['warning_level=3', 'cpp_std=c++20'])
# currently minor versions should be ABI stable
version_parts = meson.project_version().split('.')
soversion = version_parts.get(0) + '.' + version_parts.get(1)
lib = library('blurhash',
'blurhash.cpp',
include_directories: '.',
version: meson.project_version(),
soversion: soversion,
install : true)
if get_option('tests')
doctest_dep = dependency('doctest', required: true)
tests = executable('blurhash-tests',
'blurhash.cpp',
cpp_args : '-DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN',
dependencies: doctest_dep,
install : false)
test('blurhash-tests', tests)
endif
if get_option('benchmarks')
bench = executable('blurhash-decode-bench', 'blurhash-decode-bench.cpp', link_with: lib, install: false)
benchmark('blurhash-decode-bench', bench, timeout: 60, should_fail: true)
endif
if get_option('examples')
executable('blurhash2bmp', 'blurhash2bmp.cpp', link_with: lib, install: true)
executable('blurhash', 'image2blurhash.cpp', link_with: lib, install: true)
endif
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')
blurhash_dep = declare_dependency(link_with: lib, include_directories: '.')
meson.override_dependency('blurhash', blurhash_dep)