From: Navarrop Date: Fri, 24 Jun 2011 08:39:57 +0000 (+0200) Subject: Don't use the compile optimizations with gcc4.6 and osx. X-Git-Tag: v3_6_1~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9a6fdb6c8b701fd2604dc02d86a28dd596e70188 Don't use the compile optimizations with gcc4.6 and osx. Today we must use gcc4.6 to use ucontext on mac, but those flag leads to failure (for the moment ;). --- diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index 93982f45e4..5fb9835883 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -12,11 +12,16 @@ if(enable_compile_warnings) set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ") endif(enable_compile_warnings) -if(enable_compile_optimizations) - set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ") -else(enable_compile_optimizations) - set(optCFLAGS "-O0 ") -endif(enable_compile_optimizations) +if(APPLE AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6") + message(STATUS "With gcc 4.6 and OSX compile optimizations is disable") + set(optCFLAGS "-O0 ") +else(APPLE AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6") + if(enable_compile_optimizations) + set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ") + else(enable_compile_optimizations) + set(optCFLAGS "-O0 ") + endif(enable_compile_optimizations) +endif(APPLE AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6") if(NOT enable_debug) set(CMAKE_C_FLAGS "-DNDEBUG ${CMAKE_C_FLAGS}")