1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

fix linking with FFmpeg

This commit is contained in:
Andrey Filipenkov 2022-06-27 13:01:23 +03:00
parent 27551a9eae
commit ede9f33328
2 changed files with 24 additions and 3 deletions

View File

@ -279,7 +279,12 @@ endif()
# set(ZLIB_LIBRARIES "-lz")
# endif()
find_package(ffmpeg COMPONENTS avutil swscale avformat avcodec)
set(FFMPEG_COMPONENTS avutil swscale avformat avcodec)
if(APPLE_IOS)
list(APPEND FFMPEG_COMPONENTS swresample)
endif()
find_package(ffmpeg COMPONENTS ${FFMPEG_COMPONENTS})
option(FORCE_BUNDLED_MINIZIP "Force bundled Minizip library" OFF)
if(NOT FORCE_BUNDLED_MINIZIP)
find_package(minizip)

View File

@ -187,7 +187,23 @@ if(WIN32)
target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
elseif(APPLE_IOS)
target_link_libraries(vcmiclient PRIVATE
"-framework Foundation -framework UIKit -framework QuartzCore -framework CoreGraphics -framework CoreServices -framework ImageIO -framework Metal -framework OpenGLES -framework AVFoundation -framework GameController -framework CoreMotion -weak_framework CoreHaptics"
"-lbz2"
"-framework AudioToolbox"
"-framework AVFoundation"
"-framework CoreGraphics"
"-framework CoreMedia"
"-framework CoreMotion"
"-framework CoreServices"
"-framework CoreVideo"
"-framework Foundation"
"-framework GameController"
"-framework ImageIO"
"-framework Metal"
"-framework OpenGLES"
"-framework QuartzCore"
"-framework UIKit"
"-framework VideoToolbox"
"-weak_framework CoreHaptics"
)
set(ENTITLEMENTS_OUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/VCMI.entitlements)
@ -214,7 +230,7 @@ target_link_libraries(vcmiclient PRIVATE
if(ffmpeg_LIBRARIES)
target_link_libraries(vcmiclient PRIVATE
ffmpeg::swscale ffmpeg::avutil ffmpeg::avcodec ffmpeg::avformat
${ffmpeg_LIBRARIES}
)
else()
target_compile_definitions(vcmiclient PRIVATE DISABLE_VIDEO)