From 035e7bd04ea620c813adcdf402de2c25b6ce7e9c Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 26 Oct 2012 11:02:42 -0400 Subject: [PATCH] VS10: Honor /DELAYSIGN and /KEYFILE flags (#13601) Fix the VS 10 link flag map to name the project file entries correctly. The VS 11 link flag map already has the correct names. Generate the entries in the along with incremental linking options. Drop them from the element because VS does not use them. --- Source/cmVS10LinkFlagTable.h | 6 +++--- Source/cmVisualStudio10TargetGenerator.cxx | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h index c60e8eb20..64febbb52 100644 --- a/Source/cmVS10LinkFlagTable.h +++ b/Source/cmVS10LinkFlagTable.h @@ -182,8 +182,8 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] = {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0}, {"SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0}, {"Profile", "PROFILE", "", "true", 0}, - {"DelaySign", "DELAYSIGN:NO", "", "false", 0}, - {"DelaySign", "DELAYSIGN", "", "true", 0}, + {"LinkDelaySign", "DELAYSIGN:NO", "", "false", 0}, + {"LinkDelaySign", "DELAYSIGN", "", "true", 0}, {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0}, {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0}, {"ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0}, @@ -294,7 +294,7 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] = {"MergeSections", "MERGE:", "Merge Sections", "", cmVS7FlagTable::UserValue}, - {"KeyFile", "KEYFILE:", + {"LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue}, {"KeyContainer", "KEYCONTAINER:", diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index db0316373..def413326 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1106,6 +1106,23 @@ OutputLinkIncremental(std::string const& configName) *this->BuildFileStream << (manifest?manifest:"true") << "\n"; linkOptions.RemoveFlag("GenerateManifest"); + + // Some link options belong here. Use them now and remove them so that + // WriteLinkOptions does not use them. + const char* flags[] = { + "LinkDelaySign", + "LinkKeyFile", + 0}; + for(const char** f = flags; *f; ++f) + { + const char* flag = *f; + if(const char* value = linkOptions.GetFlag(flag)) + { + this->WritePlatformConfigTag(flag, configName.c_str(), 3); + *this->BuildFileStream << value << "\n"; + linkOptions.RemoveFlag(flag); + } + } } //----------------------------------------------------------------------------