Skip to content

Commit

Permalink
Fix zlib build when using ext/zlibpng.cmd (#2098)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud authored Apr 11, 2024
1 parent c92d9ec commit 98ce107
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI Fuzz
on:
pull_request:
paths:
- 'cmake/**'
- 'ext/**'
- 'include/**'
- 'src/**'
Expand Down
5 changes: 3 additions & 2 deletions cmake/Modules/LocalZlibpng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ if(EXISTS "${AVIF_SOURCE_DIR}/ext/zlib")
message(STATUS "libavif(AVIF_ZLIBPNG=LOCAL): ext/zlib found; using as FetchContent SOURCE_DIR")
set(FETCHCONTENT_SOURCE_DIR_ZLIB "${AVIF_SOURCE_DIR}/ext/zlib")
message(CHECK_START "libavif(AVIF_ZLIBPNG=LOCAL): configuring zlib")
set(ZLIB_SOURCE_DIR "${FETCHCONTENT_SOURCE_DIR_ZLIB}")
else()
message(CHECK_START "libavif(AVIF_ZLIBPNG=LOCAL): fetching and configuring zlib")
set(ZLIB_SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/zlib-src")
endif()

set(ZLIB_SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/zlib-src")
set(ZLIB_BINARY_DIR "${FETCHCONTENT_BASE_DIR}/zlib")
if(ANDROID_ABI)
set(ZLIB_BINARY_DIR "${ZLIB_BINARY_DIR}/${ANDROID_ABI}")
Expand Down Expand Up @@ -49,7 +50,7 @@ target_include_directories(zlibstatic INTERFACE $<BUILD_INTERFACE:${ZLIB_INCLUDE
# This include_directories() call and the previous include_directories() call provide the zlib
# include directories for add_subdirectory(ext/libpng). Because we set PNG_BUILD_ZLIB,
# libpng/CMakeLists.txt won't call find_package(ZLIB REQUIRED) and will see an empty
# ${ZLIB_INCLUDE_DIRS}.
# ${ZLIB_INCLUDE_DIR}.
include_directories("${zlib_BINARY_DIR}")
set(CMAKE_DEBUG_POSTFIX "")

Expand Down

0 comments on commit 98ce107

Please sign in to comment.