Browse Source

modules: link to all dependencies of statically-built SDL on Windows.

pull/397/head
Vladimír Vondruš 7 years ago
parent
commit
86a9f01dab
  1. 2
      doc/changelog.dox
  2. 23
      modules/FindSDL2.cmake

2
doc/changelog.dox

@ -93,6 +93,8 @@ See also:
- Fixed a bad interaction between @ref Magnum/Platform/AbstractXApplication.h - Fixed a bad interaction between @ref Magnum/Platform/AbstractXApplication.h
and @ref Magnum/Platform/GlfwApplication.h (see [mosra/magnum#389](https://github.com/mosra/magnum/pull/389)) 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
@subsection changelog-latest-bugfixes Bug fixes @subsection changelog-latest-bugfixes Bug fixes

23
modules/FindSDL2.cmake

@ -178,6 +178,29 @@ if(NOT TARGET SDL2::SDL2)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY set_property(TARGET SDL2::SDL2 APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${_SDL2_FRAMEWORK_LIBRARIES}) INTERFACE_LINK_LIBRARIES ${_SDL2_FRAMEWORK_LIBRARIES})
endif() endif()
# Windows dependencies for a static library. Unfortunately there's no
# easy way to figure out if a *.lib is static or dynamic, so we're
# adding only if a DLL is not found.
if(CORRADE_TARGET_WINDOWS AND NOT CORRADE_TARGET_WINDOWS_RT AND SDL2_DLL_RELEASE AND NOT SDL2_DLL_DEBUG)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES
# https://github.com/SDL-mirror/SDL/blob/release-2.0.10/CMakeLists.txt#L1338
user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32
# https://github.com/SDL-mirror/SDL/blob/release-2.0.10/CMakeLists.txt#L1384
dinput8)
# https://github.com/SDL-mirror/SDL/blob/release-2.0.10/CMakeLists.txt#L1422
# additionally has dxerr for MSVC if DirectX SDK is not used, but
# according to https://walbourn.github.io/wheres-dxerr-lib/ this
# thing is long deprecated.
if(MINGW)
set_property(TARGET SDL2::SDL2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES
# https://github.com/SDL-mirror/SDL/blob/release-2.0.10/CMakeLists.txt#L1386
dxerr8
# https://github.com/SDL-mirror/SDL/blob/release-2.0.10/CMakeLists.txt#L1388
mingw32)
endif()
endif()
else() else()
add_library(SDL2::SDL2 INTERFACE IMPORTED) add_library(SDL2::SDL2 INTERFACE IMPORTED)
endif() endif()

Loading…
Cancel
Save