diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-10-26 19:23:20 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-10-27 17:43:03 +0300 |
| commit | 3bbe66e971dfe84dcffa702c2673fb136da0a508 (patch) | |
| tree | dfad22ea1a365b4584320a92f1aa592ef868e14d /test cases/common/265 default_options dict | |
| parent | ada6236f76f4fbce4313b48eeaf9d8485516fde8 (diff) | |
| download | meson-3bbe66e971dfe84dcffa702c2673fb136da0a508.tar.gz | |
Condense test directories for RC1.
Diffstat (limited to 'test cases/common/265 default_options dict')
| -rw-r--r-- | test cases/common/265 default_options dict/lib.c | 1 | ||||
| -rw-r--r-- | test cases/common/265 default_options dict/meson.build | 22 | ||||
| -rw-r--r-- | test cases/common/265 default_options dict/meson_options.txt | 4 |
3 files changed, 27 insertions, 0 deletions
diff --git a/test cases/common/265 default_options dict/lib.c b/test cases/common/265 default_options dict/lib.c new file mode 100644 index 000000000..3ef78ee94 --- /dev/null +++ b/test cases/common/265 default_options dict/lib.c @@ -0,0 +1 @@ +#warning Make sure this is not fatal diff --git a/test cases/common/265 default_options dict/meson.build b/test cases/common/265 default_options dict/meson.build new file mode 100644 index 000000000..06edd7bf7 --- /dev/null +++ b/test cases/common/265 default_options dict/meson.build @@ -0,0 +1,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 diff --git a/test cases/common/265 default_options dict/meson_options.txt b/test cases/common/265 default_options dict/meson_options.txt new file mode 100644 index 000000000..1b0b0e1a7 --- /dev/null +++ b/test cases/common/265 default_options dict/meson_options.txt @@ -0,0 +1,4 @@ +option('bool', type: 'boolean', value: false) +option('int', type: 'integer', value: 0) +option('str', type: 'string', value: 'bar') +option('array', type: 'array', value: ['bar']) |
