PNG.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. prusaslicer_add_cmake_project(PNG
  25. GIT_REPOSITORY https://github.com/glennrp/libpng.git
  26. GIT_TAG v1.6.35
  27. DEPENDS ${ZLIB_PKG}
  28. CMAKE_ARGS
  29. -DPNG_SHARED=OFF
  30. -DPNG_STATIC=ON
  31. -DPNG_PREFIX=prusaslicer_
  32. -DPNG_TESTS=OFF
  33. -DDISABLE_DEPENDENCY_TRACKING=OFF
  34. ${_disable_neon_extension}
  35. )
  36. endif()
  37. if (MSVC)
  38. add_debug_dep(dep_PNG)
  39. endif ()