Skip to content

Commit

Permalink
Apparently, jconfig.h is not always available.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Feb 25, 2025
1 parent 908cccc commit a2034f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ endif()

if(WITH_TURBOJPEG)
target_sources(timg PUBLIC jpeg-source.h jpeg-source.cc)
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(jconfig.h JCONFIG_H_AVAILABLE)
target_compile_definitions(timg PUBLIC WITH_TIMG_JPEG)
if (JCONFIG_H_AVAILABLE)
target_compile_definitions(timg PUBLIC HAVE_JCONFIG_H)
endif()
target_link_libraries(timg
PkgConfig::TURBOJPEG
PkgConfig::EXIF)
Expand Down
2 changes: 1 addition & 1 deletion src/timg-print-version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <poppler.h>
#endif

#ifdef WITH_TIMG_JPEG
#if defined(WITH_TIMG_JPEG) && defined(HAVE_JCONFIG_H)
#include <jconfig.h>
#endif
#include <libdeflate.h>
Expand Down

0 comments on commit a2034f5

Please sign in to comment.