Fix LTO with GCC 4.9

For LTO to work, GCC 4.9 requires using the wrappers gcc-ar and gcc-ranlibs:
http://gcc.gnu.org/gcc-4.9/changes.html

CMake doesn't account for this yet:
http://public.kitware.com/pipermail/cmake-developers/2014-January/009344.html
This commit is contained in:
Tillmann Karras 2014-05-03 11:54:31 +02:00
parent a1374dd4ba
commit e22be59f82
1 changed files with 4 additions and 0 deletions

View File

@ -209,6 +209,10 @@ endif()
if(ENABLE_LTO)
check_and_add_flag(LTO -flto)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CMAKE_AR gcc-ar)
set(CMAKE_RANLIB gcc-ranlib)
endif()
endif()
if(APPLE)