0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-18 10:53:48 +02:00

configure: Add configure-time libmagick indication.

This commit is contained in:
Jason Volk 2020-09-05 15:36:55 -07:00
parent 82308ee4b3
commit feb2d41571
3 changed files with 26 additions and 1 deletions

View file

@ -1892,6 +1892,14 @@ LDFLAGS=$restore_ldflags
AM_CONDITIONAL([IMAGEMAGICK], [test "x$have_imagemagick" = "xyes"])
dnl IRCD_ENABLE_MAGICK is always defined for use in a constexpr if
AM_COND_IF([IMAGEMAGICK],
[
IRCD_DEFINE(USE_MAGICK, [1], [Magick support is available and enabled])
], [
IRCD_DEFINE(USE_MAGICK, [0], [Magick support is unavailable or disabled])
])
dnl
dnl
dnl boost support

View file

@ -110,3 +110,17 @@ struct ircd::magick::job
string_view description; // only valid for current job duration
std::exception_ptr eptr; // apropos exception reference
};
// inline stubs when magick disabled/unavailable.
#if !IRCD_USE_MAGICK
inline
ircd::magick::init::init()
{}
inline
ircd::magick::init::~init()
noexcept
{}
#endif IRCD_USE_MAGICK

View file

@ -292,8 +292,11 @@ get__thumbnail_local(client &client,
const bool fallback // Reasons to just send the original image
{
// Not available in build
!IRCD_USE_MAGICK
// Disabled by configuration
!enable
|| !enable
// Access denied for this operation
|| !permitted