inflation / jpegxl-rs

GNU General Public License v3.0
62 stars 12 forks source link

Set `JPEGXL_BUNDLE_LIBPNG` to `OFF` #71

Closed meowtec closed 2 months ago

meowtec commented 2 months ago

JPEGXL_BUNDLE_LIBPNG defaults to be true if the target is emscripten, then cmake will throw an error because libjxl/third_party/libpng is excluded.

libjxl/CMakeLists.txt:

if((SANITIZER STREQUAL "msan") OR EMSCRIPTEN)
  set(BUNDLE_LIBPNG_DEFAULT YES)

set(JPEGXL_BUNDLE_LIBPNG ${BUNDLE_LIBPNG_DEFAULT} CACHE BOOL

libjxl/third_party/CMakeLists.txt:

if (JPEGXL_BUNDLE_LIBPNG AND EMSCRIPTEN)
  if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libpng/CMakeLists.txt")
  message(FATAL_ERROR "Please run ${PROJECT_SOURCE_DIR}/deps.sh to fetch the "
          "build dependencies.")
inflation commented 2 months ago

Merged by hand in 52cc720ea3bb0d974b5e8361673a14ffe255a31d.

AFAIK the core library shouldn't link to libpng. So this could be reported to upstream as well.