-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
70 lines (60 loc) · 2.75 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
###################################################################################
# #
# NAME: meson.build #
# #
# AUTHOR: Oğuzhan Eroğlu. #
# WRITTEN BY: Michael Brockus. #
# #
# License: MIT #
# #
###################################################################################
project('jsonic', 'c',
license : 'MIT',
meson_version : '>=0.50.0',
default_options: ['warning_level=3', '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(
[
'-Wcast-qual', '-Wshadow', '-Wcast-align', '-Wweak-vtables',
'-Wold-style-cast', '-Wpointer-arith', '-Wconversion',
'-Wexit-time-destructors', '-Wglobal-constructors',
'-Wmissing-noreturn', '-Wmissing-prototypes', '-Wno-missing-braces'
]
), 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-prototypes' , '-Wold-style-definition' ,
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
'-Wno-unused-parameter' , '-Wdeclaration-after-statement'
]
), language: lang)
endif
if cc.get_id() == 'msvc'
add_project_arguments(cc.get_supported_arguments(
[
'/w44265', '/w44061', '/w44062',
'/wd4018', '/wd4146', '/wd4244',
'/wd4305', '/D _CRT_SECURE_NO_WARNINGS'
]
), language: lang)
endif
jsonic_dir = include_directories('.')
jsonic_lib = static_library(meson.project_name(),
sources: ['jsonic.c'],
include_directories: jsonic_dir)
jsonic_dep = declare_dependency(link_with: jsonic_lib, include_directories: jsonic_dir)