Skip to content

Commit 289a2b1

Browse files
committed
Add public compile definition for zlib-ng API so that other projects that use CMake and link against the zlib project can easily determine whether or not to include "zlib-ng.h" or "zlib.h".
1 parent 413bbfa commit 289a2b1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,9 @@ else()
10371037
endif()
10381038

10391039
foreach(ZLIB_INSTALL_LIBRARY ${ZLIB_INSTALL_LIBRARIES})
1040+
if(NOT ZLIB_COMPAT)
1041+
target_compile_definitions(${ZLIB_INSTALL_LIBRARY} PUBLIC ZLIBNG_NATIVE_API)
1042+
endif()
10401043
target_include_directories(${ZLIB_INSTALL_LIBRARY} PUBLIC
10411044
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
10421045
"$<INSTALL_INTERFACE:include>")

0 commit comments

Comments
 (0)