forked from benhoyt/inih
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
110 lines (98 loc) · 2.96 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
project('inih',
['c'],
license : 'BSD-3-Clause',
)
#### options ####
arg_static = []
distro_install = get_option('distro_install')
if distro_install
pkg = import('pkgconfig')
else
if not get_option('multi-line_entries')
arg_static += ['-DINI_ALLOW_MULTILINE=0']
endif
if not get_option('utf-8_bom')
arg_static += ['-DINI_ALLOW_BOM=0']
endif
if not get_option('inline_comments')
arg_static += ['-DINI_ALLOW_INLINE_COMMENTS=0']
endif
inline_comment_prefix = get_option('inline_comment_prefix')
if inline_comment_prefix != ';'
arg_static += ['-DINI_INLINE_COMMENT_PREFIXES="' + inline_comment_prefix + '"']
endif
sol_comment_prefix = get_option('start-of-line_comment_prefix')
if sol_comment_prefix != ';#'
arg_static += ['-DINI_START_COMMENT_PREFIXES="' + start-of-line_comment_prefix + '"']
endif
if get_option('allow_no_value')
arg_static += ['-DINI_ALLOW_NO_VALUE=1']
endif
if get_option('stop_on_first_error')
arg_static += ['-DINI_STOP_ON_FIRST_ERROR=1']
endif
if get_option('report_line_numbers')
arg_static += ['-DINI_HANDLER_LINENO=1']
endif
if get_option('call_handler_on_new_section')
arg_static += ['-DINI_CALL_HANDLER_ON_NEW_SECTION=1']
endif
if get_option('use_heap')
arg_static += ['-DINI_USE_STACK=0']
endif
max_line_length = get_option('max_line_length')
if max_line_length != 200
arg_static += ['-DINI_MAX_LINE=' + max_line_length.to_string()]
endif
initial_malloc_size = get_option('initial_malloc_size')
if initial_malloc_size != 200
arg_static += ['-DINI_INITIAL_ALLOC=' + initial_malloc_size.to_string()]
endif
if get_option('allow_realloc')
arg_static += ['-DINI_ALLOW_REALLOC=1']
endif
endif
#### inih ####
inc_inih = include_directories('.')
lib_inih = library('inih',
['ini.c'],
include_directories : inc_inih,
c_args : arg_static,
install : distro_install,
soversion : '0'
)
if distro_install
install_headers('ini.h')
pkg.generate(lib_inih,
name : 'inih',
description : 'simple .INI file parser',
)
endif
inih_dep = declare_dependency(
link_with : lib_inih,
compile_args : arg_static,
include_directories : inc_inih
)
#### INIReader ####
if get_option('with_INIReader')
add_languages('cpp')
inc_INIReader = include_directories('cpp')
lib_INIReader = library('INIReader',
['cpp/INIReader.cpp'],
include_directories : inc_INIReader,
dependencies : inih_dep,
install : distro_install,
soversion : '0'
)
if distro_install
install_headers('cpp/INIReader.h')
pkg.generate(lib_INIReader,
name : 'INIReader',
description : 'simple .INI file parser for C++',
)
endif
INIReader_dep = declare_dependency(
link_with : lib_INIReader,
include_directories : inc_INIReader
)
endif