[CMake] INTERPROCEDURAL_OPTIMIZATION still not using CMAKE_<LANG>_COMPILER_AR

Brad King brad.king at kitware.com
Tue Aug 1 16:52:09 EDT 2017


On 07/22/2017 07:33 AM, lectem at gmail.com wrote:
> So I downloaded the 3.9 release and thought my LTO nightmares we over but
> cmake still isn't using CMAKE_<LANG>_COMPILER_AR when linking on MSYS.

The problem is that this code:

  https://gitlab.kitware.com/cmake/cmake/blob/v3.9.0/Modules/Platform/Windows-GNU.cmake#L117-127

inserts use of the archiver into the main linking process as a way
to work around Windows command-line length limits.  Since it is
using the archiver as part of linking instead of just for creating
a static library, our logic to switch to CMAKE_<LANG>_COMPILER_AR
for LTO is not triggering.

-Brad


More information about the CMake mailing list