[CMake] Issues with adding -flto in CMAKE_C[XX]_FLAGS_RELEASE

Daniel Schepler dschepler at scalable-networks.com
Wed Apr 29 14:20:50 EDT 2015


I just tried an experiment on our code base, adding -flto to the default values of CMAKE_C_FLAGS_RELEASE and CMAKE_CXX_FLAGS_RELEASE, and setting CMAKE_AR to /usr/bin/gcc-ar-5, CMAKE_RANLIB to /usr/bin/gcc-ranlib-5.  However, make VERBOSE=1 shows that the intermediate static libraries are still being created using /usr/bin/ar; and I can't find any other instances of /usr/bin/ar in CMakeCache.txt.  That results in lots of BFD warnings showing up, and linker errors at the end.

Is there something I'm missing that would make this able to work; or is this configuration not supported (yet)?
--
Daniel Schepler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150429/4bb6063c/attachment.html>


More information about the CMake mailing list