VS: Factor out common MS tool configuration
De-duplicate code writing `PlatformToolset`.
This commit is contained in:
parent
14b0ebd4ca
commit
0ae372daee
@ -1512,7 +1512,6 @@ void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues(
|
||||
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
Elem& e1, std::string const& config)
|
||||
{
|
||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||
cmValue mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
|
||||
if (mfcFlag) {
|
||||
std::string const mfcFlagValue =
|
||||
@ -1543,12 +1542,9 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
} else {
|
||||
e1.Element("CharacterSet", "MultiByte");
|
||||
}
|
||||
if (cmValue projectToolsetOverride =
|
||||
this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
|
||||
e1.Element("PlatformToolset", *projectToolsetOverride);
|
||||
} else if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
e1.Element("PlatformToolset", toolset);
|
||||
}
|
||||
|
||||
this->WriteMSToolConfigurationValuesCommon(e1, config);
|
||||
|
||||
if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
|
||||
this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) {
|
||||
e1.Element("WindowsAppContainer", "true");
|
||||
@ -1579,8 +1575,6 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
return;
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||
|
||||
Options& o = *(this->ClOptions[config]);
|
||||
|
||||
if (o.IsDebug()) {
|
||||
@ -1598,12 +1592,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
o.RemoveFlag("Platform");
|
||||
}
|
||||
|
||||
if (cmValue projectToolsetOverride =
|
||||
this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
|
||||
e1.Element("PlatformToolset", *projectToolsetOverride);
|
||||
} else if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
e1.Element("PlatformToolset", toolset);
|
||||
}
|
||||
this->WriteMSToolConfigurationValuesCommon(e1, config);
|
||||
|
||||
std::string postfixName =
|
||||
cmStrCat(cmSystemTools::UpperCase(config), "_POSTFIX");
|
||||
@ -1623,6 +1612,18 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
oh.OutputFlagMap();
|
||||
}
|
||||
|
||||
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesCommon(
|
||||
Elem& e1, std::string const& config)
|
||||
{
|
||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||
if (cmValue projectToolsetOverride =
|
||||
this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
|
||||
e1.Element("PlatformToolset", *projectToolsetOverride);
|
||||
} else if (const char* toolset = gg->GetPlatformToolset()) {
|
||||
e1.Element("PlatformToolset", toolset);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues(
|
||||
Elem& e1, std::string const&)
|
||||
|
@ -72,6 +72,8 @@ private:
|
||||
void WriteCEDebugProjectConfigurationValues(Elem& e0);
|
||||
void WriteMSToolConfigurationValuesManaged(Elem& e1,
|
||||
std::string const& config);
|
||||
void WriteMSToolConfigurationValuesCommon(Elem& e1,
|
||||
std::string const& config);
|
||||
void WriteHeaderSource(Elem& e1, cmSourceFile const* sf,
|
||||
ConfigToSettings const& toolSettings);
|
||||
void WriteExtraSource(Elem& e1, cmSourceFile const* sf,
|
||||
|
Loading…
Reference in New Issue
Block a user