summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/meson.build
blob: e29864f46b9b908d7fdae5c0d87801ac73fd646f (plain)
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
#
# build script written by : Michael Brockus.
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
#
# license: MIT
#
project('cmock', 'c',
    license: 'MIT',
    meson_version: '>=0.53.0',
    subproject_dir : 'vendor',
    default_options: ['layout=flat', '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(
            [
                '-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

unity_dep = dependency('unity', fallback: ['unity', 'unity_dep'])

#
# Sub directory to project source code
subdir('src')
cmock_dep = declare_dependency(link_with: cmock_lib, include_directories: cmock_dir)