VS: INTERPROCEDURAL_OPTIMIZATION defaults to /LTCG:incremental
User hdf89shfdfs created a public github to demonstrate this issue.
https://github.com/hdf89shfdfs/cmake_ipo_issue
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
The code above turns on LTO but not in an always desirable fashion.
It sets /LTCG to be INCREMENTAL. Which isn’t what users will expect,
INCREMENTAL might be desirable for debug, relwithdebinfo, etc. But not release. But it looks like users have no control over it.
This issue is Windows MSVC specific.
Here is a link to the discourse: https://discourse.cmake.org/t/cmake-ipo-issue-msvc-ltcg-incremental/826