1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-21 17:17:06 +02:00

move linking to system frameworks to appropriate Find* scripts

This commit is contained in:
Andrey Filipenkov 2022-08-15 10:43:06 +03:00
parent 4452ddb404
commit 7631e7ef06
4 changed files with 37 additions and 18 deletions

View File

@ -189,23 +189,14 @@ if(WIN32)
target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
elseif(APPLE_IOS)
target_link_libraries(vcmiclient PRIVATE
"-lbz2"
# FFmpeg
bz2
iconv
z
"-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_target_properties(vcmiclient PROPERTIES
@ -247,11 +238,6 @@ if(ffmpeg_LIBRARIES)
target_link_libraries(vcmiclient PRIVATE
${ffmpeg_LIBRARIES}
)
if(APPLE_IOS)
target_link_libraries(vcmiclient PRIVATE
iconv
)
endif()
else()
target_compile_definitions(vcmiclient PRIVATE DISABLE_VIDEO)
endif()

View File

@ -345,6 +345,24 @@ if(SDL2_FOUND)
if (APPLE_MACOS)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_OPTIONS -framework Cocoa)
elseif (APPLE_IOS)
target_link_libraries(SDL2::SDL2 INTERFACE
"-framework AudioToolbox"
"-framework AVFoundation"
"-framework CoreAudio"
"-framework CoreBluetooth"
"-framework CoreFoundation"
"-framework CoreGraphics"
"-framework CoreMotion"
"-framework CoreVideo"
"-framework GameController"
"-framework IOKit"
"-framework Metal"
"-framework OpenGLES"
"-framework QuartzCore"
"-framework UIKit"
"-weak_framework CoreHaptics"
)
endif()
else()
# For threads, as mentioned Apple doesn't need this.

View File

@ -227,5 +227,14 @@ if(SDL2_IMAGE_FOUND)
IMPORTED_LOCATION "${SDL2_IMAGE_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_IMAGE_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES SDL2::SDL2)
if (APPLE_IOS)
target_link_libraries(SDL2::Image INTERFACE
"-framework CoreGraphics"
"-framework Foundation"
"-framework ImageIO"
"-framework MobileCoreServices"
"-framework UIKit"
)
endif()
endif()
endif()

View File

@ -216,5 +216,11 @@ if(SDL2_MIXER_FOUND)
IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES SDL2::SDL2)
if (APPLE_IOS)
target_link_libraries(SDL2::Mixer INTERFACE
"-framework AudioToolbox"
"-framework CoreServices"
)
endif()
endif()
endif()