Merge topic 'vs-link-debug-property'

b3677b35 VS: Map the link `/debug` to its IDE property
c22da7cf VS: Drop unused condition in link debug flag generation
4ca9df8b cmIDEOptions: Add support for case-insensitive flags
This commit is contained in:
Brad King 2016-01-12 10:22:59 -05:00 committed by CMake Topic Stage
commit b3c10efb08
7 changed files with 22 additions and 25 deletions

View File

@ -32,6 +32,7 @@ struct cmIDEFlagTable
// /NODEFAULTLIB: =>
// IgnoreDefaultLibraryNames)
UserFollowing = (1<<5), // expect value in following argument
CaseInsensitive = (1<<6), // flag may be any case
UserValueIgnored = UserValue | UserIgnored,
UserValueRequired = UserValue | UserRequired

View File

@ -13,6 +13,8 @@
#include "cmSystemTools.h"
#include <cmsys/String.h>
//----------------------------------------------------------------------------
cmIDEOptions::cmIDEOptions()
{
@ -104,7 +106,9 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
// the entry specifies UserRequired we must match only if a
// non-empty value is given.
int n = static_cast<int>(strlen(entry->commandFlag));
if(strncmp(flag+1, entry->commandFlag, n) == 0 &&
if((strncmp(flag+1, entry->commandFlag, n) == 0 ||
(entry->special & cmIDEFlagTable::CaseInsensitive &&
cmsysString_strncasecmp(flag+1, entry->commandFlag, n))) &&
(!(entry->special & cmIDEFlagTable::UserRequired) ||
static_cast<int>(strlen(flag+1)) > n))
{
@ -112,7 +116,9 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
entry_found = true;
}
}
else if(strcmp(flag+1, entry->commandFlag) == 0)
else if(strcmp(flag+1, entry->commandFlag) == 0 ||
(entry->special & cmIDEFlagTable::CaseInsensitive &&
cmsysString_strcasecmp(flag+1, entry->commandFlag) == 0))
{
if(entry->special & cmIDEFlagTable::UserFollowing)
{

View File

@ -155,7 +155,8 @@ static cmVS7FlagTable cmVS10LinkFlagTable[] =
{"AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0},
{"UACUIAccess", "uiAccess='false'", "", "false", 0},
{"UACUIAccess", "uiAccess='true'", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true",
cmVS7FlagTable::CaseInsensitive},
{"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0},

View File

@ -177,7 +177,8 @@ static cmVS7FlagTable cmVS11LinkFlagTable[] =
{"UACUIAccess", "uiAccess='false'", "", "false", 0},
{"UACUIAccess", "uiAccess='true'", "", "true", 0},
{"ManifestEmbed", "manifest:embed", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true",
cmVS7FlagTable::CaseInsensitive},
{"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0},

View File

@ -177,7 +177,8 @@ static cmVS7FlagTable cmVS12LinkFlagTable[] =
{"UACUIAccess", "uiAccess='false'", "", "false", 0},
{"UACUIAccess", "uiAccess='true'", "", "true", 0},
{"ManifestEmbed", "manifest:embed", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true",
cmVS7FlagTable::CaseInsensitive},
{"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0},

View File

@ -177,7 +177,8 @@ static cmVS7FlagTable cmVS14LinkFlagTable[] =
{"UACUIAccess", "uiAccess='false'", "", "false", 0},
{"UACUIAccess", "uiAccess='true'", "", "true", 0},
{"ManifestEmbed", "manifest:embed", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "true", 0},
{"GenerateDebugInformation", "DEBUG", "", "Debug",
cmVS7FlagTable::CaseInsensitive},
{"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0},
{"AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0},

View File

@ -2597,30 +2597,16 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
linkOptions.AddFlag("StackReserveSize", stackVal);
}
if(linkOptions.IsDebug() || flags.find("/debug") != flags.npos)
if (this->LocalGenerator->GetVersion() >=
cmGlobalVisualStudioGenerator::VS14)
{
if (this->LocalGenerator->GetVersion() >=
cmGlobalVisualStudioGenerator::VS14)
{
linkOptions.AddFlag("GenerateDebugInformation", "Debug");
}
else
{
linkOptions.AddFlag("GenerateDebugInformation", "true");
}
linkOptions.AddFlag("GenerateDebugInformation", "No");
}
else
{
if (this->LocalGenerator->GetVersion() >=
cmGlobalVisualStudioGenerator::VS14)
{
linkOptions.AddFlag("GenerateDebugInformation", "No");
}
else
{
linkOptions.AddFlag("GenerateDebugInformation", "false");
}
linkOptions.AddFlag("GenerateDebugInformation", "false");
}
std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
pdb += "/";
pdb += targetNamePDB;