do not use add_global_arguments to allow subproject use

master
Daniel Kolesa 2 years ago
parent 87038c94b0
commit 89719ba08a
  1. 1
      examples/meson.build
  2. 8
      meson.build
  3. 3
      src/meson.build
  4. 2
      tests/meson.build

@ -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

@ -17,17 +17,19 @@ libostd_includes = [include_directories('.')]
cxx = meson.get_compiler('cpp')
extra_cxxflags = []
if get_option('buildtype') != 'plain'
if cxx.has_argument('-Wshadow')
add_global_arguments('-Wshadow', language: 'cpp')
extra_cxxflags += '-Wshadow'
endif
if cxx.has_argument('-Wold-style-cast')
add_global_arguments('-Wold-style-cast', language: 'cpp')
extra_cxxflags += '-Wold-style-cast'
endif
endif
if cxx.has_argument('-fvisibility=hidden')
add_global_arguments('-fvisibility=hidden', language: 'cpp')
extra_cxxflags += '-fvisibility=hidden'
endif
subdir('src')

@ -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: ['-DOSTD_GEN_UNICODE_BUILD'] + extra_cxxflags,
install: false,
native: true
)
@ -70,6 +70,7 @@ 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,6 +2,7 @@ test_runner_exe = executable('test_runner',
['test_runner.cc'],
dependencies: libostd,
include_directories: libostd_includes,
cpp_args: extra_cxxflags,
install: false
)
@ -39,6 +40,7 @@ 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