build: generalize linking openal-soft to libfmt

Followup on the previous 3 commits to fix MSVC builds by linking libfmt
which openal-soft now needs.

Change the relevant CMake to link libfmt when it is found on all
platforms.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2025-05-11 18:10:55 +00:00
parent 5912be5a32
commit 34e46945f9
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 9 additions and 7 deletions

View File

@ -181,12 +181,10 @@ endif()
# Find OpenAL (required).
find_package(OpenAL REQUIRED)
if(WIN32)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
find_library(FMT fmtd)
else()
find_library(FMT fmt)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
find_library(FMT_LIBRARY NAMES fmtd fmt)
else()
find_library(FMT_LIBRARY fmt)
endif()
# Workaround of static liblzma not being found on MSYS2.
@ -283,8 +281,12 @@ function(configure_wx_target target)
if(OPENAL_STATIC)
_add_compile_definitions(AL_LIBTYPE_STATIC)
if(FMT_LIBRARY)
list(APPEND OPENAL_LIBRARY ${FMT_LIBRARY} avrt)
endif()
if(WIN32)
list(APPEND OPENAL_LIBRARY ${FMT} avrt)
list(APPEND OPENAL_LIBRARY avrt)
endif()
endif()
_add_include_directories(${OPENAL_INCLUDE_DIR})