Browse Source

modules: link SDL to Metal framework on iOS.

Also do it only when SDL is static -- dynamic builds don't need any of
that.
pull/415/head
Vladimír Vondruš 6 years ago
parent
commit
34aec29fb0
  1. 3
      doc/changelog.dox
  2. 9
      modules/FindSDL2.cmake

3
doc/changelog.dox

@ -150,6 +150,9 @@ See also:
and @ref Magnum/Platform/GlfwApplication.h (see [mosra/magnum#389](https://github.com/mosra/magnum/pull/389))
- `FindSDL2.cmake` got updated to link to all dependencies when using a
statically built SDL on Windows
- `FindSDL2.cmake` now links to Metal in addition to other frameworks on iOS
and is updated to link to these only if SDL is statically built (see
[mosra/magnum#410](https://github.com/mosra/magnum/issues/410))
- `FindMagnum.cmake` now properly recognizes an optional dependency between
@ref DebugTools and @ref Trade on GL-less builds
- Various compiler warning fixes (see [mosra/magnum#406](https://github.com/mosra/magnum/pull/406))

9
modules/FindSDL2.cmake

@ -117,8 +117,8 @@ if(CORRADE_TARGET_WINDOWS)
PATH_SUFFIXES ${_SDL2_RUNTIME_PATH_SUFFIX} ${_SDL2_LIBRARY_PATH_SUFFIX})
endif()
# iOS dependencies
if(CORRADE_TARGET_IOS)
# (Static) iOS dependencies
if(CORRADE_TARGET_IOS AND SDL2_LIBRARY MATCHES ".*libSDL2.a$")
set(_SDL2_FRAMEWORKS
AudioToolbox
AVFoundation
@ -126,6 +126,7 @@ if(CORRADE_TARGET_IOS)
CoreMotion
Foundation
GameController
Metal # needed since 2.0.8
QuartzCore
UIKit)
set(_SDL2_FRAMEWORK_LIBRARIES )
@ -173,8 +174,8 @@ if(NOT TARGET SDL2::SDL2)
INTERFACE_LINK_LIBRARIES Threads::Threads ${CMAKE_DL_LIBS})
endif()
# Link frameworks on iOS
if(CORRADE_TARGET_IOS)
# Link frameworks on iOS if we have a static SDL
if(CORRADE_TARGET_IOS AND SDL2_LIBRARY MATCHES ".*libSDL2.a$")
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${_SDL2_FRAMEWORK_LIBRARIES})
endif()

Loading…
Cancel
Save