zdoom-macos-deps/patch/sdl2_mixer-fix-opusfile.diff

69 lines
2.8 KiB
Diff
Raw Normal View History

2023-04-04 10:43:45 +00:00
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -369,8 +369,8 @@
)
target_include_directories(SDL2_mixer PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
- if(NOT TARGET opusfile::opusfile)
- add_library(opusfile::opusfile ALIAS opusfile)
+ if(NOT TARGET OpusFile::opusfile)
+ add_library(OpusFile::opusfile ALIAS opusfile)
endif()
if(SDL2MIXER_OPUS_SHARED OR NOT SDL2MIXER_BUILD_SHARED_LIBS)
list(APPEND INSTALL_EXTRA_TARGETS opus opusfile)
@@ -380,25 +380,25 @@
endif()
else()
message(STATUS "Using system opusfile")
- find_package(opusfile REQUIRED)
+ find_package(OpusFile REQUIRED)
if(NOT SDL2MIXER_OPUS_SHARED)
list(APPEND PC_REQUIRES opusfile)
endif()
endif()
if(SDL2MIXER_OPUS_SHARED)
target_include_directories(SDL2_mixer PRIVATE
- $<TARGET_PROPERTY:opusfile::opusfile,INCLUDE_DIRECTORIES>
- $<TARGET_PROPERTY:opusfile::opusfile,INTERFACE_INCLUDE_DIRECTORIES>
- $<TARGET_PROPERTY:opusfile::opusfile,INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:OpusFile::opusfile,INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:OpusFile::opusfile,INTERFACE_INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:OpusFile::opusfile,INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>
)
- target_get_dynamic_library(dynamic_opusfile opusfile::opusfile)
+ target_get_dynamic_library(dynamic_opusfile OpusFile::opusfile)
message(STATUS "Dynamic opus (opusfile): ${dynamic_opusfile}")
target_compile_definitions(SDL2_mixer PRIVATE "OPUS_DYNAMIC=\"${dynamic_opusfile}\"")
if(SDL2MIXER_VENDORED)
- add_dependencies(SDL2_mixer opusfile::opusfile)
+ add_dependencies(SDL2_mixer OpusFile::opusfile)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE opusfile::opusfile)
+ target_link_libraries(SDL2_mixer PRIVATE OpusFile::opusfile)
endif()
endif()
@@ -851,7 +851,7 @@
cmake/Findlibxmp.cmake
cmake/Findlibxmp-lite.cmake
cmake/Findmodplug.cmake
- cmake/Findopusfile.cmake
+ cmake/FindOpusFile.cmake
cmake/FindMPG123.cmake
cmake/FindVorbis.cmake
cmake/Findtremor.cmake
--- a/SDL2_mixerConfig.cmake.in
+++ b/SDL2_mixerConfig.cmake.in
@@ -85,6 +85,10 @@
find_dependency(vorbisfile)
endif()
+ if(SDL2MIXER_OPUS AND NOT SDL2MIXER_VENDORED AND NOT TARGET opusfile::opusfile)
+ find_dependency(OpusFile)
+ endif()
+
if((NOT SDL2MIXER_VENDORED AND SDL2MIXER_MOD_MODPLUG) OR (HAIKU AND SDL2MIXER_MIDI_NATIVE))
include(CheckLanguage)
check_language(CXX)