From 4415e52009b5387e7386887588b9c9d9665989c8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 26 Dec 2015 20:01:17 +0500 Subject: CMake: Fix errors building by MinGW Some libraries are nto updated for MinGW hence build system needs some exceptions for this compiler. --- CMakeLists.txt | 7 ++++++- source/creator/CMakeLists.txt | 48 ++++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14248d6da3a..ca23e760ff0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1585,8 +1585,13 @@ elseif(WIN32) if(WITH_SDL) set(SDL ${LIBDIR}/sdl) set(SDL_INCLUDE_DIR ${SDL}/include) - set(SDL_LIBRARY SDL2) set(SDL_LIBPATH ${SDL}/lib) + # MinGW TODO: Update MinGW to SDL2 + if(NOT CMAKE_COMPILER_IS_GNUCC) + set(SDL_LIBRARY SDL2) + else() + set(SDL_LIBRARY SDL) + endif() endif() # Audio IO diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 49fb4fe82eb..d084aeac9bd 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -623,17 +623,20 @@ elseif(WIN32) if(WITH_PYTHON) string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) - install( - FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll ${LIBDIR}/python/lib/sqlite3.dll - DESTINATION "." - CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel - ) + # MinGW TODO: This bit of Python configuration diverges from MSVC + if(NOT CMAKE_COMPILER_IS_GNUCC) + install( + FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll ${LIBDIR}/python/lib/sqlite3.dll + DESTINATION "." + CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel + ) - install( - FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll ${LIBDIR}/python/lib/sqlite3_d.dll - DESTINATION "." - CONFIGURATIONS Debug - ) + install( + FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll ${LIBDIR}/python/lib/sqlite3_d.dll + DESTINATION "." + CONFIGURATIONS Debug + ) + endif() if(WITH_PYTHON_INSTALL) # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags. @@ -793,13 +796,30 @@ elseif(WIN32) ${LIBDIR}/openal/lib/OpenAL32.dll DESTINATION "." ) + # MinGW TODO: Need to update to a newer OpenAL version + # which does not depend on wrap_oal.dll + if(CMAKE_COMPILER_IS_GNUCC) + install( + FILES + ${LIBDIR}/openal/lib/wrap_oal.dll + DESTINATION "." + ) + endif() endif() if(WITH_SDL) - install( - FILES ${LIBDIR}/sdl/lib/SDL2.dll - DESTINATION "." - ) + #MinGW TODO: Update to SDL2 + if(NOT CMAKE_COMPILER_IS_GNUCC) + install( + FILES ${LIBDIR}/sdl/lib/SDL2.dll + DESTINATION "." + ) + else() + install( + FILES ${LIBDIR}/sdl/lib/SDL.dll + DESTINATION "." + ) + endif() endif() if(WITH_SYSTEM_AUDASPACE) -- cgit v1.2.3