diff --git a/src/IMG_avif.c b/src/IMG_avif.c index d020ec31..2d7795cd 100644 --- a/src/IMG_avif.c +++ b/src/IMG_avif.c @@ -53,6 +53,10 @@ static struct { #endif int IMG_InitAVIF() +#ifdef __APPLE__ + /* Need to turn off optimizations so weak framework load check works */ + __attribute__ ((optnone)) +#endif { if ( lib.loaded == 0 ) { #ifdef LOAD_AVIF_DYNAMIC diff --git a/src/IMG_jxl.c b/src/IMG_jxl.c index d6b42d07..7ebc22d2 100644 --- a/src/IMG_jxl.c +++ b/src/IMG_jxl.c @@ -52,6 +52,10 @@ static struct { #endif int IMG_InitJXL() +#ifdef __APPLE__ + /* Need to turn off optimizations so weak framework load check works */ + __attribute__ ((optnone)) +#endif { if ( lib.loaded == 0 ) { #ifdef LOAD_JXL_DYNAMIC diff --git a/src/IMG_webp.c b/src/IMG_webp.c index 8b918c67..ea8e4a64 100644 --- a/src/IMG_webp.c +++ b/src/IMG_webp.c @@ -72,6 +72,10 @@ static struct { #endif int IMG_InitWEBP() +#ifdef __APPLE__ + /* Need to turn off optimizations so weak framework load check works */ + __attribute__ ((optnone)) +#endif { if (lib.loaded == 0) { #if defined(LOAD_WEBP_DYNAMIC) && defined(LOAD_WEBPDEMUX_DYNAMIC)