Workaround g++ 4.1 optimizer bug that creates an infinite loop in Surface_mesh_parameterization if using -O2 or -O3 option

This commit is contained in:
Laurent Saboret 2008-12-05 15:50:21 +00:00
parent e808b0d426
commit 201b369941
2 changed files with 12 additions and 2 deletions

View File

@ -9,7 +9,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
cmake_policy( SET CMP0003 NEW )
endif()
find_package(CGAL QUIET COMPONENTS Core )
@ -17,7 +17,7 @@ find_package(CGAL QUIET COMPONENTS Core )
if ( CGAL_FOUND )
# Optimization for applications dealing with large data
if (MSVC)
if (MSVC)
# Use /EHa option to catch stack overflows.
# Note: TAUCS needs a stack >= 2MB. CGAL default is 10MB.
SET (CGAL_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W2 /Zm1000 /EHa /GR")
@ -32,6 +32,11 @@ if ( CGAL_FOUND )
SET (CGAL_CXX_FLAGS_DEBUG_INIT "${CGAL_CXX_FLAGS_DEBUG_INIT} /D_HAS_ITERATOR_DEBUGGING=0")
endif()
# g++ 4.1.2 optimizer creates an infinite loop in Surface_mesh_parameterization if -O2 or -O3
if (CMAKE_COMPILER_IS_GNUCXX)
SET (CGAL_CXX_FLAGS_RELEASE_INIT "${CGAL_CXX_FLAGS_RELEASE_INIT} -O")
endif()
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )

View File

@ -32,6 +32,11 @@ if ( CGAL_FOUND )
SET (CGAL_CXX_FLAGS_DEBUG_INIT "${CGAL_CXX_FLAGS_DEBUG_INIT} /D_HAS_ITERATOR_DEBUGGING=0")
endif()
# g++ 4.1.2 optimizer creates an infinite loop in Surface_mesh_parameterization if -O2 or -O3
if (CMAKE_COMPILER_IS_GNUCXX)
SET (CGAL_CXX_FLAGS_RELEASE_INIT "${CGAL_CXX_FLAGS_RELEASE_INIT} -O")
endif()
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )