]> git.cworth.org Git - apitrace/blob - zlib/CMakeLists.txt
Silence MSVC warnings.
[apitrace] / zlib / CMakeLists.txt
1 include(CheckTypeSize)
2 include(CheckFunctionExists)
3 include(CheckIncludeFile)
4 include(CheckCSourceCompiles)
5
6 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
7 check_include_file(stdint.h    HAVE_STDINT_H)
8 check_include_file(stddef.h    HAVE_STDDEF_H)
9
10 set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
11 check_type_size(off64_t OFF64_T)
12 if(HAVE_OFF64_T)
13    add_definitions(-D_LARGEFILE64_SOURCE=1)
14 endif()
15 set(CMAKE_REQUIRED_DEFINITIONS)
16
17 check_function_exists(fseeko HAVE_FSEEKO)
18 if(NOT HAVE_FSEEKO)
19     add_definitions(-DNO_FSEEKO)
20 endif()
21
22 check_include_file(unistd.h Z_HAVE_UNISTD_H)
23
24 add_definitions(-DNO_VIZ)
25
26 if (MSVC)
27     add_definitions (-wd4127) # conditional expression is constant
28     add_definitions (-wd4131) # uses old-style declaratorion
29 endif (MSVC)
30
31 if (NOT WIN32)
32     add_definitions (-fPIC)
33 endif (NOT WIN32)
34
35 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
36
37 add_library (zlib STATIC
38     adler32.c
39     compress.c
40     crc32.c
41     gzclose.c
42     gzlib.c
43     gzread.c
44     gzwrite.c
45     uncompr.c
46     deflate.c
47     trees.c
48     zutil.c
49     inflate.c
50     infback.c
51     inftrees.c
52     inffast.c
53 )