Skip to content

Fix PNG support not being enabled in cjpeg (fixes #450)#455

Open
Alone-737 wants to merge 1 commit into
mozilla:masterfrom
Alone-737:fix/png-support-450
Open

Fix PNG support not being enabled in cjpeg (fixes #450)#455
Alone-737 wants to merge 1 commit into
mozilla:masterfrom
Alone-737:fix/png-support-450

Conversation

@Alone-737

Copy link
Copy Markdown

PNG support was broken in the shared library build because the CMake script configured the PNG flags and source files after the cjpeg target were already defined and used incorrect variables.

FIX

  1. moving the PNG setup block before the targets are created.
  2. applying the -DPNG_SUPPORTED flag to the corrected compile flags variable.
  3. correctly including rdpng.c in the source files.

The COMPILE_FLAGS and CJPEG_BMP_SOURCES variables were set after the cjpeg
target was already defined and were never referenced by any target, so
-DPNG_SUPPORTED was never added to the cjpeg compile flags and rdpng.c was
never included in the cjpeg source list.

This patch:
- Adds -DPNG_SUPPORTED to CDJPEG_COMPILE_FLAGS (the variable actually used
  by the cjpeg target) before the target is defined
- Includes rdpng.c in the cjpeg executable and cjpeg12/cjpeg16 object
  library source lists via CJPEG_PNG_SOURCES
- Consolidates the two redundant if(PNG_SUPPORTED) blocks into one for
  find_package and target linking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant