summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/scripts/linux/docker.sh3
-rw-r--r--.gitmodules4
-rw-r--r--externals/zlib/CMakeLists.txt81
m---------externals/zlib/zlib (renamed from externals/zlib)0
4 files changed, 84 insertions, 4 deletions
diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh
index 090ca75f1..5559a527c 100644
--- a/.ci/scripts/linux/docker.sh
+++ b/.ci/scripts/linux/docker.sh
@@ -11,5 +11,4 @@ ninja
11 11
12ccache -s 12ccache -s
13 13
14# Ignore zlib's tests, since they aren't gated behind a CMake option. 14ctest -VV -C Release
15ctest -VV -E "(example|example64)" -C Release
diff --git a/.gitmodules b/.gitmodules
index ee0dc6c19..c60628f4b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -50,5 +50,5 @@
50 path = externals/libzip 50 path = externals/libzip
51 url = https://github.com/DarkLordZach/libzip 51 url = https://github.com/DarkLordZach/libzip
52[submodule "zlib"] 52[submodule "zlib"]
53 path = externals/zlib 53 path = externals/zlib/zlib
54 url = https://github.com/madler/zlib 54 url = https://github.com/madler/zlib.git
diff --git a/externals/zlib/CMakeLists.txt b/externals/zlib/CMakeLists.txt
new file mode 100644
index 000000000..0ca32aae4
--- /dev/null
+++ b/externals/zlib/CMakeLists.txt
@@ -0,0 +1,81 @@
1project(zlib C)
2
3include(CheckTypeSize)
4include(CheckFunctionExists)
5include(CheckIncludeFile)
6
7check_include_file(sys/types.h HAVE_SYS_TYPES_H)
8check_include_file(stdint.h HAVE_STDINT_H)
9check_include_file(stddef.h HAVE_STDDEF_H)
10
11# Check to see if we have large file support
12set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
13# We add these other definitions here because CheckTypeSize.cmake
14# in CMake 2.4.x does not automatically do so and we want
15# compatibility with CMake 2.4.x.
16if(HAVE_SYS_TYPES_H)
17 list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
18endif()
19if(HAVE_STDINT_H)
20 list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
21endif()
22if(HAVE_STDDEF_H)
23 list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
24endif()
25check_type_size(off64_t OFF64_T)
26if(HAVE_OFF64_T)
27 add_definitions(-D_LARGEFILE64_SOURCE=1)
28endif()
29set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
30
31# Check for fseeko
32check_function_exists(fseeko HAVE_FSEEKO)
33if(NOT HAVE_FSEEKO)
34 add_definitions(-DNO_FSEEKO)
35endif()
36
37# Check for unistd.h
38check_include_file(unistd.h HAVE_UNISTD_H)
39if(HAVE_UNISTD_H)
40 add_definitions(-DHAVE_UNISTD_H)
41endif()
42
43if(MSVC)
44 add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
45 add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
46endif()
47
48add_library(z STATIC
49 zlib/adler32.c
50 zlib/compress.c
51 zlib/crc32.c
52 zlib/crc32.h
53 zlib/deflate.c
54 zlib/deflate.h
55 zlib/gzclose.c
56 zlib/gzguts.h
57 zlib/gzlib.c
58 zlib/gzread.c
59 zlib/gzwrite.c
60 zlib/inffast.h
61 zlib/inffixed.h
62 zlib/inflate.c
63 zlib/inflate.h
64 zlib/infback.c
65 zlib/inftrees.c
66 zlib/inftrees.h
67 zlib/inffast.c
68 zlib/trees.c
69 zlib/trees.h
70 zlib/uncompr.c
71 zlib/zconf.h
72 zlib/zlib.h
73 zlib/zutil.c
74 zlib/zutil.h
75)
76add_library(ZLIB::ZLIB ALIAS z)
77
78target_include_directories(z
79PUBLIC
80 zlib/
81)
diff --git a/externals/zlib b/externals/zlib/zlib
Subproject cacf7f1d4e3d44d871b605da3b647f07d718623 Subproject cacf7f1d4e3d44d871b605da3b647f07d718623