Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add optimization flag with gcc46.
authorNavarrop <Pierre.Navarro@imag.fr>
Fri, 21 Oct 2011 10:32:35 +0000 (12:32 +0200)
committerNavarrop <Pierre.Navarro@imag.fr>
Fri, 21 Oct 2011 10:33:13 +0000 (12:33 +0200)
buildtools/Cmake/Flags.cmake

index 41e84a0..983b40c 100644 (file)
@@ -13,12 +13,15 @@ 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)
 
        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_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
-    set(warnCFLAGS "${warnCFLAGS} -Wno-error=unused-but-set-variable ")
-endif(enable_compile_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+#if(enable_compile_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
+#    set(warnCFLAGS "${warnCFLAGS} -Wno-error=unused-but-set-variable ")
+#endif(enable_compile_warnings AND COMPILER_C_VERSION_MAJOR_MINOR MATCHES "4.6")
 
 if(enable_compile_optimizations)
        set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
 
 if(enable_compile_optimizations)
        set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
+       if(${COMPILER_C_VERSION_MAJOR_MINOR} STRGREATER "4.5")
+           set(optCFLAGS "${optCFLAGS}-flto ")
+       endif(${COMPILER_C_VERSION_MAJOR_MINOR} STRGREATER "4.5")
 else(enable_compile_optimizations)
         set(optCFLAGS "-O0 ")
 endif(enable_compile_optimizations)
 else(enable_compile_optimizations)
         set(optCFLAGS "-O0 ")
 endif(enable_compile_optimizations)