From b3677b35d320cce5d23831ec398d6bb283d1444e Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 8 Jan 2016 14:38:58 -0500 Subject: VS: Map the link `/debug` to its IDE property Fix the link flag table entries for this flag to be case-insensitive. Also fix the VS 2015 value for the build property enumeration name. This causes `linkOptions.Parse(...)` to correctly extract the `/debug` flag and map it to the IDE property instead. Therefore we do not need to look for the flag explicitly when initializing the property. --- Source/cmVS10LinkFlagTable.h | 3 ++- Source/cmVS11LinkFlagTable.h | 3 ++- Source/cmVS12LinkFlagTable.h | 3 ++- Source/cmVS14LinkFlagTable.h | 3 ++- Source/cmVisualStudio10TargetGenerator.cxx | 24 +++++------------------- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h index f6b758d..dd92329 100644 --- a/Source/cmVS10LinkFlagTable.h +++ b/Source/cmVS10LinkFlagTable.h @@ -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}, diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h index 0f641e4..2d6f6c0 100644 --- a/Source/cmVS11LinkFlagTable.h +++ b/Source/cmVS11LinkFlagTable.h @@ -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}, diff --git a/Source/cmVS12LinkFlagTable.h b/Source/cmVS12LinkFlagTable.h index e5a570e..0be5e34 100644 --- a/Source/cmVS12LinkFlagTable.h +++ b/Source/cmVS12LinkFlagTable.h @@ -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}, diff --git a/Source/cmVS14LinkFlagTable.h b/Source/cmVS14LinkFlagTable.h index 6d81d12..1e781e8 100644 --- a/Source/cmVS14LinkFlagTable.h +++ b/Source/cmVS14LinkFlagTable.h @@ -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}, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 56f724f..2120035 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2597,30 +2597,16 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) linkOptions.AddFlag("StackReserveSize", stackVal); } - if(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; -- cgit v0.12