Skip to content

Commit

Permalink
Merge pull request ThrowTheSwitch#514 from michaelbrockus/let_meson_h…
Browse files Browse the repository at this point in the history
…andle_flags

Let meson handle flags
  • Loading branch information
mvandervoord authored Aug 6, 2020
2 parents 09acb0b + 62d0e7d commit 9804592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
36 changes: 1 addition & 35 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,8 @@
project('unity', 'c',
license: 'MIT',
meson_version: '>=0.53.0',
default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11']
default_options: ['werror=true', 'c_std=c11']
)
lang = 'c'
cc = meson.get_compiler(lang)

#
# Meson: Add compiler flags
if cc.get_id() == 'clang'
add_project_arguments(cc.get_supported_arguments(
[
'-Wexit-time-destructors',
'-Wglobal-constructors',
'-Wmissing-prototypes',
'-Wmissing-noreturn',
'-Wno-missing-braces',
'-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables',
'-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow'
]
), language: lang)
endif

if cc.get_argument_syntax() == 'gcc'
add_project_arguments(cc.get_supported_arguments(
[
'-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar',
'-Wpointer-arith' , '-Wwrite-strings' ,
'-Wno-parentheses' , '-Wno-type-limits' ,
'-Wformat-security' , '-Wunreachable-code' ,
'-Waggregate-return' , '-Wformat-nonliteral' ,
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
'-Wno-unused-parameter'
]
), language: lang)
endif

#
# Sub directory to project source code
subdir('src')
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
unity_dir = include_directories('.')

unity_lib = static_library(meson.project_name(),
sources: ['unity.c'],
files('unity.c'),
include_directories: unity_dir)

0 comments on commit 9804592

Please sign in to comment.