less bad compiler warnings handling

master
Daniel Kolesa 2 years ago
parent 2077ff0752
commit 4b560b54f4
  1. 1
      examples/meson.build
  2. 18
      meson.build
  3. 3
      src/meson.build
  4. 2
      tests/meson.build

@ -20,7 +20,6 @@ foreach example: libostd_examples_src
[example],
dependencies: [libostd, thread_dep],
include_directories: libostd_includes,
cpp_args: extra_cxxflags,
install: false
)
endforeach

@ -1,6 +1,6 @@
project('libostd', ['cpp'],
version: '0.1.0',
default_options: ['buildtype=plain', 'cpp_std=c++17'],
default_options: ['buildtype=plain', 'cpp_std=c++17', 'warning_level=3'],
meson_version: '>=0.46'
)
@ -15,15 +15,17 @@ unicode_data = join_paths('data', 'UnicodeData-11.0.txt')
libostd_includes = [include_directories('.')]
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 = []
endif
cxx = meson.get_compiler('cpp')
if get_option('buildtype') != 'plain'
if cxx.has_argument('-Wshadow')
add_global_arguments('-Wshadow', language: 'cpp')
endif
if cxx.has_argument('-Wold-style-cast')
add_global_arguments('-Wold-style-cast', language: 'cpp')
endif
endif
if cxx.has_argument('-fvisibility=hidden')
add_global_arguments('-fvisibility=hidden', language: 'cpp')
endif

@ -49,7 +49,7 @@ thread_dep = dependency('threads')
libostd_gen_unicode_exe = executable('gen_unicode',
['../gen_unicode.cc'],
include_directories: libostd_includes,
cpp_args: extra_cxxflags + ['-DOSTD_GEN_UNICODE_BUILD'],
cpp_args: ['-DOSTD_GEN_UNICODE_BUILD'],
install: false,
native: true
)
@ -70,7 +70,6 @@ libostd_lib = both_libraries('ostd',
libostd_src, libostd_extra_src,
dependencies: thread_dep,
include_directories: libostd_includes + [include_directories('.')],
cpp_args: extra_cxxflags,
install: true,
version: meson.project_version()
)

@ -2,7 +2,6 @@ test_runner_exe = executable('test_runner',
['test_runner.cc'],
dependencies: libostd,
include_directories: libostd_includes,
cpp_args: extra_cxxflags,
install: false
)
@ -40,7 +39,6 @@ foreach test_idx: libostd_tests_indices
[libostd_tests_src[test_idx]],
dependencies: libostd,
include_directories: libostd_includes,
cpp_args: extra_cxxflags,
install: false
)
endforeach

Loading…
Cancel
Save