don't load modules if they are built in

Only load modules if libvips has been built as a set of modules.
Otherwise can can end up loading operations twice.
This commit is contained in:
John Cupitt 2021-07-03 11:14:58 +01:00
parent 75a3b08c91
commit 70182e4eac
3 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
14/8/20 started 8.11.2
- better libdir guessing [remi]
- don't load modules if we're built without modules
14/8/20 started 8.11.1
- add more example code to C docs

View File

@ -459,6 +459,7 @@ else
if test x"$gmodule_supported" = x"true"; then
gmodule_supported_flag=yes
gmodule_with_flag='module'
AC_DEFINE(ENABLE_MODULES,1,[define to enable loadable module support.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])

View File

@ -536,11 +536,17 @@ vips_init( const char *argv0 )
vips_mosaicing_operation_init();
vips_g_input_stream_get_type();
#ifdef ENABLE_MODULES
/* Load any vips8 modules from the vips libdir. Keep going, even if
* some modules fail to load.
*
* Only do this if we have been built as a set of loadable
* modules, or we might try loading an operation into a library that
* already has that operation built in.
*/
(void) vips_load_plugins( "%s/vips-modules-%d.%d",
libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION );
#endif /*ENABLE_MODULES*/
#if ENABLE_DEPRECATED
/* Load any vips8 plugins from the vips libdir.