summaryrefslogtreecommitdiff
path: root/test cases/common/265 default_options dict/meson.build
blob: 06edd7bf7158f1b03ef3c8c99918e8f3929cc74c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
project('test default options', 'c',
    default_options: {
        'bool': true,
        'int': 42,
        'str': 'foo',
        'array': ['foo'],
        'werror': true,
    },
)

assert(get_option('bool') == true)
assert(get_option('int') == 42)
assert(get_option('str') == 'foo')
assert(get_option('array') == ['foo'])
assert(get_option('werror') == true)

cc = meson.get_compiler('c')

# MSVC does not support #warning
if cc.get_id() != 'msvc'
  static_library('foo', 'lib.c', override_options: {'werror': false})
endif