PNG.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. if (APPLE)
  2. # Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
  3. set(_disable_neon_extension "-DPNG_ARM_NEON=off")
  4. else ()
  5. set(_disable_neon_extension "")
  6. endif ()
  7. if(APPLE AND IS_CROSS_COMPILE)
  8. # TODO: check if it doesn't create problem when compiling from arm to x86_64
  9. prusaslicer_add_cmake_project(PNG
  10. GIT_REPOSITORY https://github.com/glennrp/libpng.git
  11. GIT_TAG v1.6.35
  12. DEPENDS ${ZLIB_PKG}
  13. PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
  14. ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch
  15. CMAKE_ARGS
  16. -DPNG_SHARED=OFF
  17. -DPNG_STATIC=ON
  18. -DPNG_PREFIX=prusaslicer_
  19. -DPNG_TESTS=OFF
  20. -DDISABLE_DEPENDENCY_TRACKING=OFF
  21. ${_disable_neon_extension}
  22. )
  23. else ()
  24. set(_patch_step "")
  25. if (APPLE)
  26. set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
  27. endif ()
  28. prusaslicer_add_cmake_project(PNG
  29. # GIT_REPOSITORY https://github.com/glennrp/libpng.git
  30. # GIT_TAG v1.6.35
  31. URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
  32. URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
  33. DEPENDS ${ZLIB_PKG}
  34. "${_patch_step}"
  35. CMAKE_ARGS
  36. -DPNG_SHARED=OFF
  37. -DPNG_STATIC=ON
  38. -DPNG_PREFIX=prusaslicer_
  39. -DPNG_TESTS=OFF
  40. -DDISABLE_DEPENDENCY_TRACKING=OFF
  41. ${_disable_neon_extension}
  42. )
  43. endif()
  44. if (MSVC)
  45. add_debug_dep(dep_PNG)
  46. endif ()