From: Augustin Degomme Date: Thu, 7 Nov 2013 23:02:22 +0000 (+0100) Subject: flto has not the right effect with clang X-Git-Tag: v3_10_rc2~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7d9cb71065fb6332d8ff28f85b4abf7a4b9d8afc flto has not the right effect with clang (cherry picked from commit 56d1e384b07f2eacd980c30a447504cdf5f1d6ef) --- diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index 4c1178d63d..058ea2d979 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -26,15 +26,17 @@ endif() if(enable_compile_optimizations) set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ") - if(WIN32) - if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.7") - # On windows, we need 4.8 or higher to enable lto because of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50293 - set(optCFLAGS "${optCFLAGS} -flto ") - endif() - else() - # On non-windows, 4.6 is enough for that - if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5") - set(optCFLAGS "${optCFLAGS} -flto ") + if(CMAKE_COMPILER_IS_GNUCC) + if(WIN32) + if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.7") + # On windows, we need 4.8 or higher to enable lto because of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50293 + set(optCFLAGS "${optCFLAGS} -flto ") + endif() + else() + # On non-windows, 4.6 is enough for that + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5") + set(optCFLAGS "${optCFLAGS} -flto ") + endif() endif() endif() else()