Browse Source

modules: Handle SDL2 library achitecture when building on windows.

Signed-off-by: Squareys <Squareys@googlemail.com>
pull/166/head
Squareys 10 years ago
parent
commit
64d94a12b2
  1. 11
      modules/FindSDL2.cmake

11
modules/FindSDL2.cmake

@ -43,14 +43,19 @@
if(CORRADE_TARGET_EMSCRIPTEN)
set(_SDL2_PATH_SUFFIXES SDL)
else()
# Precompiled libraries for Windows are in x86/x64 subdirectories
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_SDL_LIBRARY_PATH_SUFFIX lib/x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(_SDL_LIBRARY_PATH_SUFFIX lib/x86)
endif()
find_library(SDL2_LIBRARY
# Compiling SDL2 from scratch on OSX creates dead libSDL2.so symlink
# which CMake somehow prefers before the SDL2-2.0.dylib file. Making
# the dylib first so it is preferred.
NAMES SDL2-2.0 SDL2
# Precompiled libraries for Windows are in x86/x64 subdirectories
PATH_SUFFIXES lib/x86 lib/x64)
PATH_SUFFIXES ${_SDL_LIBRARY_PATH_SUFFIX})
set(SDL2_LIBRARY_NEEDED SDL2_LIBRARY)
set(_SDL2_PATH_SUFFIXES SDL2)
endif()

Loading…
Cancel
Save