From 34e46945f90b8f69825ecbb765db54aeda2dfb63 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 11 May 2025 18:10:55 +0000 Subject: [PATCH] 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 --- src/wx/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 5c93ce53..2e4ee9d0 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -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})