From 39cad5feb8bbcf0773871dbabb4346158fe3f55c Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 23 May 2025 01:34:22 +0000 Subject: [PATCH] build: fix build with -DENABLE_OPENAL=TRUE Followup on 8ced18c2 (build: make OpenAL-Soft optional again, 2025-05-22), put the sources for OpenAL support in the right place in the CMake file for the build to work. Signed-off-by: Rafael Kitover --- src/wx/CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 58cce9e9..445f6b43 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -186,17 +186,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg") set(wxWidgets_LIB_DIR "${wxWidgets_LIB_DIR}" CACHE INTERNAL "wxWidgets library directory" FORCE) endif() -if(ENABLE_OPENAL) - find_package(OpenAL REQUIRED) - - target_sources(visualboyadvance-m PRIVATE - audio/internal/openal.cpp - audio/internal/openal.h - ) - - target_compile_definitions(visualboyadvance-m PRIVATE VBAM_ENABLE_OPENAL) -endif() - # Workaround of static liblzma not being found on MSYS2. if(VBAM_STATIC AND MSYS) unset(cleaned_up_wx_libs) @@ -410,6 +399,18 @@ else() target_include_directories(visualboyadvance-m PRIVATE ${SDL2_INCLUDE_DIRS}) endif() +if(ENABLE_OPENAL) + find_package(OpenAL REQUIRED) + + target_sources(visualboyadvance-m PRIVATE + audio/internal/openal.cpp + audio/internal/openal.h + ) + + target_compile_definitions(visualboyadvance-m PRIVATE VBAM_ENABLE_OPENAL) +endif() + + target_link_libraries( visualboyadvance-m vbam-components-draw-text