diff options
| author | Mika Lindqvist <postmaster@raasu.org> | 2021-05-25 17:46:46 +0300 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2021-05-27 12:39:23 +0200 |
| commit | 414ec0f00d85394849d0ce26c799faf094e2b6fb (patch) | |
| tree | f1368477f9f48995d2b75fa95569e92b4e9bdbbe | |
| parent | 8b5630050aa541c2e49632bf2dc69b70f4120f5d (diff) | |
| download | Project-Tick-414ec0f00d85394849d0ce26c799faf094e2b6fb.tar.gz Project-Tick-414ec0f00d85394849d0ce26c799faf094e2b6fb.zip | |
Fix build under Cygwin.
| -rw-r--r-- | CMakeLists.txt | 7 | ||||
| -rw-r--r-- | test/minideflate.c | 3 | ||||
| -rw-r--r-- | test/switchlevels.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f800c0398a..a7ff3b09de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -945,13 +945,13 @@ set(ZLIB_GZFILE_SRCS gzwrite.c ) -if(NOT MINGW AND NOT MSYS) +if(NOT MINGW AND NOT MSYS AND NOT CYGWIN) set(ZLIB_DLL_SRCS win32/zlib${SUFFIX}1.rc # If present will override custom build rule below. ) endif() -if(MINGW OR MSYS) +if(MINGW OR MSYS OR CYGWIN) # This gets us DLL resource information when compiling on MinGW. if(NOT CMAKE_RC_COMPILER) set(CMAKE_RC_COMPILER windres.exe) @@ -1033,7 +1033,8 @@ if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) # Match configure/make's behavior (i.e. don't use @rpath on mac). set_target_properties(zlib PROPERTIES INSTALL_NAME_DIR "${LIB_INSTALL_DIR}") endif() - elseif(MSYS) + endif() + if(MSYS OR CYGWIN) # Suppress version number from shared library name set(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 0) elseif(WIN32) diff --git a/test/minideflate.c b/test/minideflate.c index 392516852d..8ce57fad58 100644 --- a/test/minideflate.c +++ b/test/minideflate.c @@ -3,6 +3,9 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +#define _POSIX_SOURCE 1 /* This file needs POSIX for fileno(). */ +#define _POSIX_C_SOURCE 200112 /* For snprintf(). */ + #include <stdio.h> #include <stddef.h> #include <stdint.h> diff --git a/test/switchlevels.c b/test/switchlevels.c index 0f850113e2..a4ec4b7c76 100644 --- a/test/switchlevels.c +++ b/test/switchlevels.c @@ -2,6 +2,8 @@ * Each chunk is compressed with a user-specified level. */ +#define _POSIX_SOURCE 1 /* This file needs POSIX for fileno(). */ + #include "zbuild.h" #ifdef ZLIB_COMPAT # include "zlib.h" |
