-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
zlib.cmake
41 lines (36 loc) · 986 Bytes
/
zlib.cmake
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
# IMPORTANT: do not use add_compile_options(), add_definitions() or similar functions here since it will leak to the including projects
set(ZLIB_SOURCES_BASE
adler32.c
compress.c
crc32.c
uncompr.c
deflate.c
gzguts.h
trees.c
zutil.c
inflate.c
infback.c
inftrees.c
inffast.c
crc32.h
deflate.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zconf.h
zlib.h
zutil.h
)
if(HOST_WIN32 OR CLR_CMAKE_TARGET_WIN32)
set(ZLIB_SOURCES_BASE ${ZLIB_SOURCES_BASE} ../../libs/System.IO.Compression.Native/zlib_allocator_win.c)
else()
set(ZLIB_SOURCES_BASE ${ZLIB_SOURCES_BASE} ../../libs/System.IO.Compression.Native/zlib_allocator_unix.c)
endif()
addprefix(ZLIB_SOURCES "${CMAKE_CURRENT_LIST_DIR}/zlib" "${ZLIB_SOURCES_BASE}")
# enable custom zlib allocator
set(ZLIB_COMPILE_DEFINITIONS "MY_ZCALLOC")
if(HOST_WIN32 OR CLR_CMAKE_TARGET_WIN32)
set(ZLIB_COMPILE_OPTIONS "/wd4127;/wd4131")
endif()