meson: do not set global cxxflags

this is so that libostd can work as a subproject
This commit is contained in:
q66 2018-10-28 00:53:58 +02:00
parent 875172e0d8
commit d4573427d9
4 changed files with 8 additions and 6 deletions

View file

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

View file

@ -16,12 +16,10 @@ 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'
add_global_arguments(
'-Wextra', '-Wshadow', '-Wold-style-cast',
language: 'cpp'
)
extra_cxxflags = ['-Wextra', '-Wshadow', '-Wold-style-cast']
else
extra_cxxflags = []
endif
subdir('src')

View file

@ -49,7 +49,7 @@ thread_dep = dependency('threads')
libostd_gen_unicode_exe = executable('gen_unicode',
['../gen_unicode.cc'],
include_directories: libostd_includes,
cpp_args: '-DOSTD_GEN_UNICODE_BUILD',
cpp_args: extra_cxxflags + ['-DOSTD_GEN_UNICODE_BUILD'],
install: false,
native: true
)
@ -70,6 +70,7 @@ libostd_lib = library('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()
)

View file

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