[CMake] How to turn off incremental linking for MSVC Debug and RelWithDebInfo targets?

Erwin Coumans erwin.coumans at gmail.com
Thu Feb 11 18:46:28 EST 2010


I can't find where this INCREMENTAL:YES is coming from.

Is there a better way than hacking the 'cmLocalVisualStudio7Generator
::GetBuildTypeLinkerFlags'
to replace INCREMENTAL:YES by INCREMENTAL:NO?

Thanks a lot,
Erwin




//----------------------------------------------------------------------------
std::string
cmLocalVisualStudio7Generator
::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char*
configName)
{
  std::string configTypeUpper = cmSystemTools::UpperCase(configName);
  std::string extraLinkOptionsBuildTypeDef =
    rootLinkerFlags + "_" + configTypeUpper;

  std::string extraLinkOptionsBuildType =
    this->Makefile->GetRequiredDefinition
    (extraLinkOptionsBuildTypeDef.c_str());

  cmSystemTools::ReplaceString(extraLinkOptionsBuildType,
"/INCREMENTAL:YES", "/INCREMENTAL:NO");

  return extraLinkOptionsBuildType;
}


On 9 February 2010 11:40, John Drescher <drescherjm at gmail.com> wrote:

> >>      STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags
> >> ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
> >>      message (${replacementFlags})
> >>      SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG ${replacementFlags})
> >>
> >>
> >>      STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags2
> >> ${CMAKE_EXE_LINKER_FLAGS})
> >>      message (${replacementFlags2})
> >>      SET(CMAKE_EXE_LINKER_FLAGS ${replacementFlag2})
> >>
> >>
> >> Is there a method using CMake 2.8 or CMake 2.8.1 that works?
> >>
>
> I thought that the following worked in the past since I have this in
> my CMakeLists.txt:
>  SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /MANIFEST /STACK:10000000 ")
>
> but it appears that this no longer works with cmake 2.8.0. I believe
> it worked previously.
>
> I do not have a solution for this yet.
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100211/99f170d2/attachment-0001.htm>


More information about the CMake mailing list