Skip to content

Commit 69aa24a

Browse files
authored
Disable visibility attributes on Windows to fix msys2 -Wattributes warning (#2281)
Skip GCC visibility (default/hidden) when _WIN32 is defined so MinGW and msys2 builds use empty export macros and avoid 'visibility attribute not supported in this configuration; ignored'. Made-with: Cursor Signed-off-by: Cary Phillips <cary@ilm.com>
1 parent b19cfec commit 69aa24a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmake/OpenEXRConfig.h.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@
127127
///
128128
/// @{
129129

130+
// Visibility attributes are ELF-specific; on Windows (MSVC or MinGW) they are
131+
// not supported and trigger -Wattributes warnings, so use empty macros there.
130132
#if defined(OPENEXR_ENABLE_API_VISIBILITY) && \
131-
!(defined(OPENEXR_DLL) || defined(_MSC_VER))
133+
!(defined(OPENEXR_DLL) || defined(_MSC_VER) || defined(_WIN32))
132134
# define OPENEXR_PUBLIC_SYMBOL_ATTRIBUTE \
133135
__attribute__ ((__visibility__ ("default")))
134136
# define OPENEXR_PRIVATE_SYMBOL_ATTRIBUTE \

0 commit comments

Comments
 (0)