more generic handling of warning args and default to debugoptimized

master
Daniel Kolesa 2021-03-16 00:52:23 +01:00
parent 45b1535685
commit 5b104da85b
1 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
project('libcubescript', ['cpp'],
version: '0.1.0',
default_options: ['buildtype=plain', 'cpp_std=c++2a'],
default_options: ['buildtype=debugoptimized', 'cpp_std=c++2a'],
meson_version: '>=0.46'
)
@ -13,11 +13,17 @@ dir_package_include = join_paths(dir_include, 'cubescript')
libcubescript_includes = [include_directories('include')]
tgt_compiler_id = meson.get_compiler('cpp').get_id()
if tgt_compiler_id == 'gcc' or tgt_compiler_id == 'clang'
extra_cxxflags = ['-Wextra', '-Wshadow', '-Wold-style-cast']
else
extra_cxxflags = []
cxx = meson.get_compiler('cpp')
extra_cxxflags = []
if get_option('buildtype') != 'plain'
if cxx.has_argument('-Wshadow')
extra_cxxflags += '-Wshadow'
endif
if cxx.has_argument('-Wold-style-cast')
extra_cxxflags += '-Wold-style-cast'
endif
endif
subdir('src')