[cmake] CheckLibfmt.cmake: Only remove FMT_SHARED if fmt::fmt is a valid target.

If the internal libfmt is used, it might not be a valid target.

This fixes a regression from commit 06f2f46655.
([cmake] CheckLibfmt.cmake: Remove FMT_SHARED from INTERFACE_COMPILE_DEFINITIONS.)
This commit is contained in:
David Korth 2025-02-17 20:38:47 -05:00
parent 51640dd4f0
commit 84163ba5d5

View File

@ -64,8 +64,8 @@ ENDIF(USE_INTERNAL_FMT)
# This causes parts of `class format_error` to be exported from
# libromdata.so, which could result in multiple definitions.
# (Not needed for Win32.)
IF(NOT WIN32)
IF(NOT WIN32 AND TARGET fmt::fmt)
SET_TARGET_PROPERTIES(fmt::fmt PROPERTIES
INTERFACE_COMPILE_DEFINITIONS ""
)
ENDIF(NOT WIN32)
ENDIF(NOT WIN32 AND TARGET fmt::fmt)