Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2012-04-24 00:09:59 +0400
committerAntony Riakiotakis <kalast@gmail.com>2012-04-24 00:09:59 +0400
commit8b476d0275be15fbe18c9a0589e81a996e952496 (patch)
treee896508c392601d61944e6e091b014bbcf924b69 /CMakeLists.txt
parent95432a2a2bc371eab628e7846bb5736f236d0efe (diff)
First MinGW-w64 support for cmake has been added. To test I recommend this build:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/ray_linn/GCC-4.7.0-with-ada/mingw-w64-gcc-4.7.0-runtime-2.0.1-static-ada-20120330.7z/download Other builds may also work but due to the constantly changing nature of the compiler this cannot be guaranteed. I often had to change compilers while building the libraries and this one is the one that did the job for most of them. This first support is experimental and considered "advanced". To enable pass -DWITH_MINGW64 during cmake configuration. Also make sure to extract the compiler on C:/MinGW and that MinGW/bin is in your path. To build check out lib/mingw64. Initially the support is lacking until I get every library compiled correctly. For now you should disable WITH_CYCLES(sorry, I know some people are dying to do benchmarks, but still a few libs to go), WITH_IMAGE_OPENEXR, WITH_OPENCOLLADA, WITH_LIBMV and WITH_CODEC_FFMPEG(links but hangs on startup). Still the tools are working, the memory limit is increased and due to the experimental nature of the setup, full optimization with SSE2 is available, which makes the build quite fast. Also the compiler and especially, the linker are way faster than regular MinGW. The wiki docs have also updated. Happy testing!
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt53
1 files changed, 42 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1595e78ea4c..b5f7d171890 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -233,6 +233,8 @@ if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
+option(WITH_MINGW64 "Use the 64-bit version of MinGW" OFF)
+mark_as_advanced(WITH_MINGW64)
# Cycles
option(WITH_CYCLES "Enable cycles Render Engine" ON)
@@ -370,6 +372,10 @@ if(MINGW)
"because it is currently unsupported, remove this "
"line if youre a developer who wants to add support.")
endif()
+
+ if((WITH_MINGW64) AND (WITH_IMAGE_OPENEXR OR WITH_CYCLES OR WITH_OPENCOLLADA OR WITH_LIBMV OR WITH_CODEC_FFMPEG))
+ message(FATAL_ERROR "MINGW64 still doesn't support: WITH_CYCLES/WITH_IMAGE_OPENEXR/WITH_OPENCOLLADA/WITH_LIBMV/WITH_CODEC_FFMPEG")
+ endif()
endif()
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
@@ -737,6 +743,12 @@ elseif(WIN32)
if(CMAKE_COMPILER_IS_GNUCC)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
+
+ # Setup 64bit and 64bit windows systems
+ if(WITH_MINGW64)
+ message("Set 64 bit compiler for MinGW.")
+ set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
+ endif()
else()
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
@@ -995,12 +1007,19 @@ elseif(WIN32)
set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
elseif(CMAKE_COMPILER_IS_GNUCC)
- # keep GCC specific stuff here
- set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
-
+ # keep GCC specific stuff here
set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi")
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
+ if(WITH_MINGW64)
+ #Yes, the point for MinGW64 is moar optimization by default :)
+ set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -msse -msse2 -O3")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
+ set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lsetupapi -lpthread")
+
+ add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
+ endif()
+
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
@@ -1017,7 +1036,11 @@ elseif(WIN32)
set(PNG_INCLUDE_DIR "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
- set(JPEG_LIBRARIES libjpeg)
+ if(WITH_MINGW64)
+ set(JPEG_LIBRARIES jpeg)
+ else()
+ set(JPEG_LIBRARIES libjpeg)
+ endif()
set(PNG_LIBRARIES png)
set(ZLIB ${LIBDIR}/zlib)
@@ -1025,11 +1048,14 @@ elseif(WIN32)
set(ZLIB_LIBPATH ${ZLIB}/lib)
set(ZLIB_LIBRARIES z)
- set(PTHREADS ${LIBDIR}/pthreads)
- set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
- set(PTHREADS_LIBPATH ${PTHREADS}/lib)
- set(PTHREADS_LIBRARIES pthreadGC2)
-
+ #comes with own pthread library
+ if(NOT WITH_MINGW64)
+ set(PTHREADS ${LIBDIR}/pthreads)
+ set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
+ set(PTHREADS_LIBPATH ${PTHREADS}/lib)
+ set(PTHREADS_LIBRARIES pthreadGC2)
+ endif()
+
set(FREETYPE ${LIBDIR}/freetype)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
@@ -1101,8 +1127,13 @@ elseif(WIN32)
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
- set(BOOST_POSTFIX "mgw46-mt-s-1_47")
- set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
+ if(WITH_MINGW64)
+ set(BOOST_POSTFIX "mgw47-mt-s-1_49")
+ set(BOOST_DEBUG_POSTFIX "mgw47-mt-sd-1_49")
+ else()
+ set(BOOST_POSTFIX "mgw46-mt-s-1_47")
+ set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
+ endif()
set(BOOST_LIBRARIES
optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}