mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 22:08:56 +00:00
CMake: don't try to use bundled zlib when the system's path is in the cache
The code surrounding zlib bundling did not take into consideration that ZLIB_LIBRARY gets cached, and assumed that FIND(ZLIB) would always set ZLIB_FOUND, which does not hold true, as this variable signifies that we have found the package and had to look at the system, as its location was not cached. Only use the bundled sources if the external zlib is neither newly-found nor cached.
This commit is contained in:
parent
62221033a8
commit
000e68961c
@ -131,7 +131,9 @@ ENDIF()
|
|||||||
IF (ZLIB_FOUND)
|
IF (ZLIB_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
||||||
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
||||||
ELSE()
|
# Fake the message CMake would have shown
|
||||||
|
MESSAGE("-- Found zlib: ${ZLIB_LIBRARY}")
|
||||||
|
ELSEIF (NOT ZLIB_LIBRARY)
|
||||||
MESSAGE( "zlib was not found; using bundled 3rd-party sources." )
|
MESSAGE( "zlib was not found; using bundled 3rd-party sources." )
|
||||||
INCLUDE_DIRECTORIES(deps/zlib)
|
INCLUDE_DIRECTORIES(deps/zlib)
|
||||||
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP)
|
ADD_DEFINITIONS(-DNO_VIZ -DSTDC -DNO_GZIP)
|
||||||
|
Loading…
Reference in New Issue
Block a user