-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
62 lines (52 loc) · 1.4 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
project(
'cando',
'c',
version: '0.1.4',
license: 'MIT',
meson_version: '>=1.3.1',
default_options: [
'warning_level=2',
'werror=true',
'prefix=/usr/'
],
)
pargs = []
cc = meson.get_compiler('c')
so_version = '.'.join(meson.project_version())
project_name = meson.project_name()
src_root_dir = meson.current_source_dir()
build_root_dir = meson.current_build_dir()
file_ops = get_option('file-ops')
inc = include_directories('include')
subdir('include')
subdir('src')
libcando = library(
project_name, files(fs),
version: '.'.join(so_version),
include_directories: inc,
c_args: pargs,
install: true
)
pkg = import('pkgconfig')
pkglibs = []
pkgsubdirs = []
pkg.generate(libraries: [pkglibs, libcando],
subdirs : pkgsubdirs,
version : so_version,
name : project_name,
filebase : 'cando',
description : 'A common utility library for C programs/libraries.')
if get_option('tests')
subdir('tests')
endif
if get_option('docs')
docs_dir = src_root_dir + '/docs'
docs_build_dir = build_root_dir + '/docs'
sphinx = find_program('sphinx-build-5', 'sphinx-build', required: true)
if sphinx.found()
subdir('docs')
custom_target('docs',
command: [sphinx, '-W', '-b', 'html', docs_dir, '@OUTPUT@'],
input: docs_src, output: 'docs', install: false, install_dir: '')
endif
endif