Debian Codegraph @

test cases/common/265 default_options dict/meson.build

raw
1 project('test default options', 'c',
2 default_options: {
3 'bool': true,
4 'int': 42,
5 'str': 'foo',
6 'array': ['foo'],
7 'werror': true,
8 },
9 )
10
11 assert(get_option('bool') == true)
12 assert(get_option('int') == 42)
13 assert(get_option('str') == 'foo')
14 assert(get_option('array') == ['foo'])
15 assert(get_option('werror') == true)
16
17 cc = meson.get_compiler('c')
18
19 # MSVC does not support #warning
20 if cc.get_id() != 'msvc'
21 static_library('foo', 'lib.c', override_options: {'werror': false})
22 endif