diff options
| author | Vollstrecker <werner@vollstreckernet.de> | 2025-02-18 08:47:58 +0100 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2025-02-18 15:00:15 -0800 |
| commit | 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71 (patch) | |
| tree | 973c98322bf8da6ce656bdd45500f3397615492e | |
| parent | 7108497fda9d4536a1afade7f42266e06dca4488 (diff) | |
| download | zlib-develop.tar.gz zlib-develop.tar.bz2 zlib-develop.zip | |
This restores the inclusion of the local zconf.h (double quoted)
in normal usage.
| -rw-r--r-- | CMakeLists.txt | 7 | ||||
| -rw-r--r-- | test/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | zlib.h | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 83f0ffd..aa73591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -119,7 +119,6 @@ unset(CMAKE_COMPILE_FLAGS) | |||
| 119 | set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc) | 119 | set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc) |
| 120 | configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY) | 120 | configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY) |
| 121 | configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h) | 121 | configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h) |
| 122 | include_directories(${zlib_BINARY_DIR} ${zlib_SOURCE_DIR}) | ||
| 123 | 122 | ||
| 124 | # ============================================================================ | 123 | # ============================================================================ |
| 125 | # zlib | 124 | # zlib |
| @@ -172,7 +171,8 @@ if(ZLIB_BUILD_SHARED) | |||
| 172 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | 171 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) |
| 173 | target_compile_definitions( | 172 | target_compile_definitions( |
| 174 | zlib | 173 | zlib |
| 175 | PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO> | 174 | PRIVATE ZLIB_BUILD |
| 175 | $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO> | ||
| 176 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> | 176 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> |
| 177 | $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE> | 177 | $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE> |
| 178 | $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE> | 178 | $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE> |
| @@ -214,7 +214,8 @@ if(ZLIB_BUILD_STATIC) | |||
| 214 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | 214 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) |
| 215 | target_compile_definitions( | 215 | target_compile_definitions( |
| 216 | zlibstatic | 216 | zlibstatic |
| 217 | PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO> | 217 | PRIVATE ZLIB_BUILD |
| 218 | $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO> | ||
| 218 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> | 219 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN> |
| 219 | $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE> | 220 | $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE> |
| 220 | $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE> | 221 | $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE> |
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 46c07eb..0d2844d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt | |||
| @@ -16,6 +16,7 @@ endfunction() | |||
| 16 | if(ZLIB_BUILD_SHARED) | 16 | if(ZLIB_BUILD_SHARED) |
| 17 | add_executable(zlib_example example.c) | 17 | add_executable(zlib_example example.c) |
| 18 | target_link_libraries(zlib_example ZLIB::ZLIB) | 18 | target_link_libraries(zlib_example ZLIB::ZLIB) |
| 19 | target_compile_definitions(zlib_example PRIVATE ZLIB_BUILD) | ||
| 19 | add_test(NAME zlib_example COMMAND zlib_example) | 20 | add_test(NAME zlib_example COMMAND zlib_example) |
| 20 | 21 | ||
| 21 | add_executable(minigzip minigzip.c) | 22 | add_executable(minigzip minigzip.c) |
| @@ -38,7 +39,7 @@ if(ZLIB_BUILD_SHARED) | |||
| 38 | add_executable(zlib_example64 example.c) | 39 | add_executable(zlib_example64 example.c) |
| 39 | target_compile_definitions( | 40 | target_compile_definitions( |
| 40 | zlib_example64 | 41 | zlib_example64 |
| 41 | PRIVATE LARGEFILE64_SOURCE=1 | 42 | PRIVATE ZLIB_BUILD |
| 42 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) | 43 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) |
| 43 | target_link_libraries(zlib_example64 ZLIB::ZLIB) | 44 | target_link_libraries(zlib_example64 ZLIB::ZLIB) |
| 44 | add_test(NAME zlib_example64 COMMAND zlib_example64) | 45 | add_test(NAME zlib_example64 COMMAND zlib_example64) |
| @@ -61,7 +62,8 @@ if(ZLIB_BUILD_STATIC) | |||
| 61 | target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC) | 62 | target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC) |
| 62 | target_compile_definitions( | 63 | target_compile_definitions( |
| 63 | zlib_static_example | 64 | zlib_static_example |
| 64 | PRIVATE $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) | 65 | PRIVATE ZLIB_BUILD |
| 66 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) | ||
| 65 | add_test(NAME zlib_static_example COMMAND zlib_static_example) | 67 | add_test(NAME zlib_static_example COMMAND zlib_static_example) |
| 66 | 68 | ||
| 67 | add_executable(static_minigzip minigzip.c) | 69 | add_executable(static_minigzip minigzip.c) |
| @@ -116,7 +118,7 @@ if(ZLIB_BUILD_STATIC) | |||
| 116 | add_executable(zlib_static_example64 example.c) | 118 | add_executable(zlib_static_example64 example.c) |
| 117 | target_compile_definitions( | 119 | target_compile_definitions( |
| 118 | zlib_static_example64 | 120 | zlib_static_example64 |
| 119 | PRIVATE LARGEFILE64_SOURCE=1 | 121 | PRIVATE ZLIB_BUILD |
| 120 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) | 122 | $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>) |
| 121 | target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC) | 123 | target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC) |
| 122 | add_test(NAME zlib_static_example64 COMMAND zlib_static_example64) | 124 | add_test(NAME zlib_static_example64 COMMAND zlib_static_example64) |
| @@ -31,7 +31,11 @@ | |||
| 31 | #ifndef ZLIB_H | 31 | #ifndef ZLIB_H |
| 32 | #define ZLIB_H | 32 | #define ZLIB_H |
| 33 | 33 | ||
| 34 | #include <zconf.h> | 34 | #ifdef ZLIB_BUILD |
| 35 | # include <zconf.h> | ||
| 36 | #else | ||
| 37 | # include "zconf.h" | ||
| 38 | #endif | ||
| 35 | 39 | ||
| 36 | #ifdef __cplusplus | 40 | #ifdef __cplusplus |
| 37 | extern "C" { | 41 | extern "C" { |
