Debian Codegraph @

vendored-meson/meson/test cases/common/87 default options/meson.build

raw
1 project('default options', 'cpp', 'c', default_options : [
2 'prefix=/absoluteprefix',
3 'buildtype=debugoptimized',
4 'cpp_std=c++11',
5 'cpp_eh=none',
6 'warning_level=3',
7 'sub1:test_option=false',
8 ])
9
10 assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.')
11
12 cpp_eh = get_option('cpp_eh')
13 assert(cpp_eh == 'none', 'EH value is "' + cpp_eh + '" instead of "none"')
14 cpp_std = get_option('cpp_std')
15 assert(cpp_std == 'c++11', 'C++ std value is "' + cpp_std + '" instead of c++11.')
16
17 w_level = get_option('warning_level')
18 assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"')
19
20 # FIXME. Since we no longer accept invalid options to c_std etc,
21 # there is no simple way to test this. Gcc does not seem to expose
22 # the C std used in a preprocessor token so we can't check for it.
23 # Think of a way to fix this.
24 #
25 # # Verify that project args are not used when told not to.
26 # # MSVC plain C does not have a simple arg to test so skip it.
27 # if cpp.get_id() != 'msvc'
28 # cc = meson.get_compiler('c')
29 # assert(not cc.compiles('int foobar;'), 'Default arg not used in test.')
30 # assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.')
31 # endif
32
33 subproject('sub1', default_options: 'func_test_option=true')