CMake: Fix errors building by MinGW
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 26 Dec 2015 15:01:17 +0000 (20:01 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 26 Dec 2015 15:01:17 +0000 (20:01 +0500)
Some libraries are nto updated for MinGW hence build system
needs some exceptions for this compiler.

CMakeLists.txt
source/creator/CMakeLists.txt

index 14248d6da3ade25b6aaed71853c8b041c74a8be9..ca23e760ff0aa31bd76dc3eeaeb6cfc9e5576f19 100644 (file)
@@ -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
index 49fb4fe82eb41339712a901fda2c04c16619ef84..d084aeac9bd77f37444c6f395eca7b9233f56248 100644 (file)
@@ -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)