[Bf-blender-cvs] [4415e52] master: CMake: Fix errors building by MinGW

Sergey Sharybin noreply at git.blender.org
Sat Dec 26 16:02:26 CET 2015


Commit: 4415e52009b5387e7386887588b9c9d9665989c8
Author: Sergey Sharybin
Date:   Sat Dec 26 20:01:17 2015 +0500
Branches: master
https://developer.blender.org/rB4415e52009b5387e7386887588b9c9d9665989c8

CMake: Fix errors building by MinGW

Some libraries are nto updated for MinGW hence build system
needs some exceptions for this compiler.

===================================================================

M	CMakeLists.txt
M	source/creator/CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14248d6..ca23e76 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 49fb4fe..d084aea 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)




More information about the Bf-blender-cvs mailing list