Skip to content

Commit

Permalink
cmake: use correct libpng target + don't disable libpng versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr authored and sezero committed Dec 15, 2023
1 parent 28b9daa commit 5a17e5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ if(SDL2IMAGE_ZLIB)
else()
set(ZLIB_LIBRARY zlibstatic)
endif()
# ZLIB_INCLUDE_DIRS variable is used by vendored libpng
set(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
# ZLIB_LIBRARIES variable is used by vendored libpng
set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
list(APPEND INSTALL_EXTRA_TARGETS ${ZLIB_LIBRARY})
set_target_properties(${ZLIB_LIBRARY} PROPERTIES EXPORT_NAME external_zlib)
add_library(SDL2_image::external_zlib ALIAS ${ZLIB_LIBRARY})
Expand Down Expand Up @@ -553,13 +557,12 @@ if(SDL2IMAGE_PNG)
SDL_IMAGE_SAVE_PNG=$<BOOL:${SDL2IMAGE_PNG_SAVE}>
)
if(NOT SDL2IMAGE_BACKEND_STB AND NOT SDL2IMAGE_BACKEND_WIC AND NOT SDL2IMAGE_BACKEND_IMAGEIO)
set(HAVE_LD_VERSION_SCRIPT OFF CACHE BOOL "" FORCE)
if(SDL2IMAGE_PNG_VENDORED)
message(STATUS "${PROJECT_NAME}: Using vendored libpng")
sdl_check_project_in_subfolder(external/libpng libpng SDL2IMAGE_VENDORED)
add_subdirectory(external/libpng EXCLUDE_FROM_ALL)
if(SDL2IMAGE_PNG_SHARED)
set(PNG_LIBRARY png)
set(PNG_LIBRARY png_shared)
else()
set(PNG_LIBRARY png_static)
endif()
Expand Down
2 changes: 1 addition & 1 deletion external/libpng
Submodule libpng updated 1 files
+1 −1 CMakeLists.txt
2 changes: 1 addition & 1 deletion external/zlib
Submodule zlib updated 1 files
+2 −2 CMakeLists.txt

0 comments on commit 5a17e5e

Please sign in to comment.