2020-01-04 14:21:38 +00:00
|
|
|
project(
|
2020-02-29 20:34:08 +00:00
|
|
|
'tomlplusplus',
|
|
|
|
'cpp',
|
|
|
|
version : '0.2.2',
|
2020-01-04 14:21:38 +00:00
|
|
|
license : 'MIT',
|
|
|
|
default_options : [
|
|
|
|
'cpp_std=c++17',
|
|
|
|
'warning_level=3',
|
2020-02-29 20:34:08 +00:00
|
|
|
'werror=true',
|
2020-01-04 14:21:38 +00:00
|
|
|
'cpp_eh=default'
|
|
|
|
]
|
|
|
|
)
|
2020-02-29 20:34:08 +00:00
|
|
|
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
compiler = meson.get_compiler('cpp')
|
2020-02-29 20:34:08 +00:00
|
|
|
message(['compiler ID: ', compiler.get_id()])
|
2020-01-06 18:21:16 +00:00
|
|
|
|
|
|
|
if compiler.get_id() == 'gcc'
|
2020-02-29 20:34:08 +00:00
|
|
|
add_project_arguments([
|
|
|
|
'-fmax-errors=5',
|
|
|
|
'-Wno-attributes',
|
|
|
|
'-Wno-init-list-lifetime'
|
|
|
|
],
|
|
|
|
language : 'cpp'
|
|
|
|
)
|
2020-01-04 14:21:38 +00:00
|
|
|
endif
|
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
if compiler.get_id() == 'clang'
|
2020-02-29 20:34:08 +00:00
|
|
|
add_project_arguments([
|
|
|
|
'-ferror-limit=5',
|
|
|
|
'-fchar8_t',
|
|
|
|
'-Wno-c++98-compat',
|
|
|
|
'-Wno-c++98-compat-pedantic',
|
|
|
|
'-Wno-float-equal',
|
|
|
|
'-Wno-switch-enum',
|
|
|
|
'-Wno-documentation-unknown-command',
|
|
|
|
'-Wno-padded',
|
|
|
|
'-Wno-weak-vtables',
|
|
|
|
'-Wno-double-promotion'
|
|
|
|
#, '-Weverything'
|
|
|
|
],
|
|
|
|
language : 'cpp'
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if compiler.get_id() == 'intel-cl'
|
|
|
|
add_project_arguments([
|
|
|
|
'/Qoption,cpp,--unicode_source_kind,UTF-8',
|
|
|
|
'/std=c++latest',
|
|
|
|
'/wd82', # storage class is not first
|
|
|
|
'/wd280', # selector expression is constant (why the fuck is that a warning?)
|
|
|
|
'/wd411', # class provides no constructor (duh, it's an aggregate)
|
|
|
|
'/wd1011', # missing return statement (false negative)
|
|
|
|
'/wd1628', # function marked [[noreturn]] returns (false positive)
|
|
|
|
'/wd3280' # declaration hides member (triggered in Catch2)
|
|
|
|
],
|
|
|
|
language : 'cpp'
|
|
|
|
)
|
2020-01-04 14:21:38 +00:00
|
|
|
endif
|
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
compiler_supports_char8_strings = compiler.compiles('''
|
|
|
|
#include <string_view>
|
|
|
|
#include <string>
|
|
|
|
using namespace std::string_view_literals;
|
|
|
|
std::u8string func()
|
|
|
|
{
|
|
|
|
return std::u8string{ u8"this is a test."sv };
|
|
|
|
}
|
|
|
|
''',
|
|
|
|
name : 'char8 string check',
|
|
|
|
args : [ '-std=c++2a' ]
|
|
|
|
)
|
|
|
|
|
|
|
|
inc = include_directories(['include', 'extern'])
|
2020-01-04 14:21:38 +00:00
|
|
|
|
|
|
|
subdir('tests')
|
2020-01-06 18:21:16 +00:00
|
|
|
# subdir('examples')
|