Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding minim support for Meson build system. #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
I ###################################################################################
# #
# NAME: meson.build #
# #
# AUTHOR: Serge Zaitsev. #
# #
# WRITTEN BY: Michael Brockus. #
# #
# CONTACT: <mailto:[email protected]> #
# #
# NOTICES: #
# #
# License: MIT #
# #
###################################################################################



project('jsmn', 'c',
license : 'MIT',
meson_version : '>=0.50.0',
default_options :
[
'b_lundef=true',
'werror=true',
'optimization=3',
'warning_level=3',
'c_std=c11'
]
)
cc = meson.get_compiler('c')
args_for_langs = 'c'



##
#
# Meson: Add compiler flags
#
##
if cc.get_id() == 'clang'
add_project_arguments(
cc.get_supported_arguments(
[
'-Wweak-vtables',
'-Wexit-time-destructors',
'-Wglobal-constructors',
'-Wmissing-noreturn'
]
), language: args_for_langs)
endif

if cc.get_argument_syntax() == 'gcc'
add_project_arguments(
cc.get_supported_arguments(
[
'-Wunreachable-code',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wredundant-decls',
'-Wundef',
'-Wwrite-strings',
'-Wformat',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wold-style-definition',
'-Winit-self',
'-Wmissing-include-dirs',
'-Waddress',
'-Waggregate-return',
'-Wno-multichar',
'-Wno-parentheses',
'-Wno-unused-parameter',
'-Wno-type-limits',
'-Wdeclaration-after-statement',
'-Wvla',
'-Wpointer-arith'
]
), language: args_for_langs)
endif

if cc.get_id() == 'msvc'
add_project_arguments(
cc.get_supported_arguments(
[
'/w44265',
'/w44061',
'/w44062',
'/wd4018', # implicit signed/unsigned conversion
'/wd4146', # unary minus on unsigned (beware INT_MIN)
'/wd4244', # lossy type conversion (e.g. double -> int)
'/wd4305', # truncating type conversion (e.g. double -> float)
]
), language: args_for_langs)
endif

jsmn_dep = declare_dependency(include_directories: include_directories('.'))