Cleanup optimization compile flags for mingw-w64.
authorAntony Riakiotakis <kalast@gmail.com>
Mon, 14 May 2012 23:36:07 +0000 (23:36 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Mon, 14 May 2012 23:36:07 +0000 (23:36 +0000)
After testing it seems that for safe debug sessions, debug build optimizations need to be off.

Also removed sse flags from release flags since they are included in ray optimization flags which are on by default.

CMakeLists.txt
build_files/scons/config/win64-mingw-config.py

index d39dfd9e999b83744c003d07abce034b767e5035..6b34c36d90db571ffd8c926670f201c2d976455c 100644 (file)
@@ -1011,8 +1011,10 @@ elseif(WIN32)
                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 -ftree-vectorize")
+                       #We need to take care though not to have these on debug builds because they may play funky with gdb
+                       if(CMAKE_BUILD_TYPE MATCHES "Release")
+                               set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -ftree-vectorize")
+                       endif()
                        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
                        set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
                        
index 37e4bcd77a86ce16aca0c397e51192cec75b4ab8..cecf91e48a82e736125ddec269b44100bf3aec27 100644 (file)
@@ -167,7 +167,7 @@ BF_BOOST_LIBPATH = BF_BOOST + '/lib'
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
-BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2', '-ftree-vectorize']
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
 
 #Produces errors while rendering with subsurf/multires,
 WITH_BF_OPENMP = False
@@ -182,7 +182,7 @@ CXXFLAGS = [ '-fpermissive' ]
 CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC']
 REL_CFLAGS = []
 REL_CXXFLAGS = []
-REL_CCFLAGS = ['-DNDEBUG', '-O2', '-mmmx', '-msse', '-msse2', '-ftree-vectorize']
+REL_CCFLAGS = ['-DNDEBUG', '-O2', '-ftree-vectorize']
 
 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']