-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
55 lines (48 loc) · 1.2 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
project('zlib', 'c',
version : '1.2.11',
license : 'zlib',
meson_version : '>= 0.48.0'
)
cc = meson.get_compiler('c')
link_args = []
compile_args = []
if cc.get_id() == 'msvc'
add_project_arguments('-D_CRT_SECURE_NO_DEPRECATE',
'-D_CRT_NONSTDC_NO_DEPRECATE', language : 'c')
else
# Don't spam consumers of this wrap with these warnings
compile_args += cc.get_supported_arguments(['-Wno-implicit-fallthrough',
'-Wno-implicit-function-declaration'])
if cc.get_id() == 'gcc' and host_machine.system() != 'windows'
vflag = '-Wl,--version-script,@0@/zlib.map'.format(meson.current_source_dir())
link_args += [vflag]
endif
endif
src = files(
'adler32.c',
'crc32.c',
'deflate.c',
'infback.c',
'inffast.c',
'inflate.c',
'inftrees.c',
'trees.c',
'zutil.c',
'compress.c',
'uncompr.c',
'gzclose.c',
'gzlib.c',
'gzread.c',
'gzwrite.c'
)
zlib = static_library('z', src,
c_args : compile_args,
link_args : link_args,
install : false
)
incdir = include_directories('.')
zlib_dep = declare_dependency(
include_directories : incdir,
link_with : zlib,
version : meson.project_version()
)