The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
9 years ago
|
project('default options', 'cpp', 'c', default_options : [
|
||
8 years ago
|
'prefix=/absoluteprefix',
|
||
9 years ago
|
'buildtype=debugoptimized',
|
||
8 years ago
|
'cpp_std=c++11',
|
||
9 years ago
|
'cpp_eh=none',
|
||
8 years ago
|
'warning_level=3',
|
||
9 years ago
|
])
|
||
|
|
||
8 years ago
|
cpp_id = meson.get_compiler('cpp').get_id()
|
||
9 years ago
|
|
||
|
assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.')
|
||
|
|
||
8 years ago
|
if cpp_id == 'msvc'
|
||
8 years ago
|
cpp_eh = get_option('cpp_eh')
|
||
|
assert(cpp_eh == 'none', 'MSVC eh value is "' + cpp_eh + '" instead of "none"')
|
||
9 years ago
|
else
|
||
8 years ago
|
cpp_std = get_option('cpp_std')
|
||
8 years ago
|
assert(cpp_std == 'c++11', 'C++ std value is "' + cpp_std + '" instead of c++11.')
|
||
9 years ago
|
endif
|
||
9 years ago
|
|
||
8 years ago
|
w_level = get_option('warning_level')
|
||
|
assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"')
|
||
|
|
||
9 years ago
|
# FIXME. Since we no longer accept invalid options to c_std etc,
|
||
|
# there is no simple way to test this. Gcc does not seem to expose
|
||
|
# the C std used in a preprocessor token so we can't check for it.
|
||
|
# Think of a way to fix this.
|
||
|
#
|
||
|
# # Verify that project args are not used when told not to.
|
||
|
# # MSVC plain C does not have a simple arg to test so skip it.
|
||
|
# if cpp.get_id() != 'msvc'
|
||
|
# cc = meson.get_compiler('c')
|
||
|
# assert(not cc.compiles('int foobar;'), 'Default arg not used in test.')
|
||
|
# assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.')
|
||
|
# endif
|
||
9 years ago
|
|