mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
configure: Add configure-time libmagick indication.
This commit is contained in:
parent
82308ee4b3
commit
feb2d41571
3 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue