diff options
| -rw-r--r-- | .ci/scripts/linux/docker.sh | 3 | ||||
| -rw-r--r-- | .gitmodules | 4 | ||||
| -rw-r--r-- | externals/zlib/CMakeLists.txt | 81 | ||||
| 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 | ||
| 12 | ccache -s | 12 | ccache -s |
| 13 | 13 | ||
| 14 | # Ignore zlib's tests, since they aren't gated behind a CMake option. | 14 | ctest -VV -C Release |
| 15 | ctest -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 @@ | |||
| 1 | project(zlib C) | ||
| 2 | |||
| 3 | include(CheckTypeSize) | ||
| 4 | include(CheckFunctionExists) | ||
| 5 | include(CheckIncludeFile) | ||
| 6 | |||
| 7 | check_include_file(sys/types.h HAVE_SYS_TYPES_H) | ||
| 8 | check_include_file(stdint.h HAVE_STDINT_H) | ||
| 9 | check_include_file(stddef.h HAVE_STDDEF_H) | ||
| 10 | |||
| 11 | # Check to see if we have large file support | ||
| 12 | set(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. | ||
| 16 | if(HAVE_SYS_TYPES_H) | ||
| 17 | list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H) | ||
| 18 | endif() | ||
| 19 | if(HAVE_STDINT_H) | ||
| 20 | list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H) | ||
| 21 | endif() | ||
| 22 | if(HAVE_STDDEF_H) | ||
| 23 | list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H) | ||
| 24 | endif() | ||
| 25 | check_type_size(off64_t OFF64_T) | ||
| 26 | if(HAVE_OFF64_T) | ||
| 27 | add_definitions(-D_LARGEFILE64_SOURCE=1) | ||
| 28 | endif() | ||
| 29 | set(CMAKE_REQUIRED_DEFINITIONS) # clear variable | ||
| 30 | |||
| 31 | # Check for fseeko | ||
| 32 | check_function_exists(fseeko HAVE_FSEEKO) | ||
| 33 | if(NOT HAVE_FSEEKO) | ||
| 34 | add_definitions(-DNO_FSEEKO) | ||
| 35 | endif() | ||
| 36 | |||
| 37 | # Check for unistd.h | ||
| 38 | check_include_file(unistd.h HAVE_UNISTD_H) | ||
| 39 | if(HAVE_UNISTD_H) | ||
| 40 | add_definitions(-DHAVE_UNISTD_H) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | if(MSVC) | ||
| 44 | add_definitions(-D_CRT_SECURE_NO_DEPRECATE) | ||
| 45 | add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) | ||
| 46 | endif() | ||
| 47 | |||
| 48 | add_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 | ) | ||
| 76 | add_library(ZLIB::ZLIB ALIAS z) | ||
| 77 | |||
| 78 | target_include_directories(z | ||
| 79 | PUBLIC | ||
| 80 | zlib/ | ||
| 81 | ) | ||
diff --git a/externals/zlib b/externals/zlib/zlib | |||
| Subproject cacf7f1d4e3d44d871b605da3b647f07d718623 | Subproject cacf7f1d4e3d44d871b605da3b647f07d718623 | ||