mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-24 07:28:54 -06:00
VS: Write UseOfMfc tag only if CMAKE_MFC_FLAG is present
Don't bother writing `UseOfMfc` to `.vcxproj` files when the value is just the default of `0`. This keeps the files cleaner. Patch-by: vvs31415 on gitlab.kitware.com
This commit is contained in:
@@ -982,19 +982,21 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
|||||||
const char* mfcFlag =
|
const char* mfcFlag =
|
||||||
this->GeneratorTarget->Target->GetMakefile()->GetDefinition(
|
this->GeneratorTarget->Target->GetMakefile()->GetDefinition(
|
||||||
"CMAKE_MFC_FLAG");
|
"CMAKE_MFC_FLAG");
|
||||||
std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
|
if (mfcFlag) {
|
||||||
|
std::string const mfcFlagValue = mfcFlag;
|
||||||
|
|
||||||
std::string useOfMfcValue = "false";
|
std::string useOfMfcValue = "false";
|
||||||
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
|
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
|
||||||
if (mfcFlagValue == "1") {
|
if (mfcFlagValue == "1") {
|
||||||
useOfMfcValue = "Static";
|
useOfMfcValue = "Static";
|
||||||
} else if (mfcFlagValue == "2") {
|
} else if (mfcFlagValue == "2") {
|
||||||
useOfMfcValue = "Dynamic";
|
useOfMfcValue = "Dynamic";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
std::string mfcLine = "<UseOfMfc>";
|
||||||
|
mfcLine += useOfMfcValue + "</UseOfMfc>\n";
|
||||||
|
this->WriteString(mfcLine.c_str(), 2);
|
||||||
}
|
}
|
||||||
std::string mfcLine = "<UseOfMfc>";
|
|
||||||
mfcLine += useOfMfcValue + "</UseOfMfc>\n";
|
|
||||||
this->WriteString(mfcLine.c_str(), 2);
|
|
||||||
|
|
||||||
if ((this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY &&
|
if ((this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY &&
|
||||||
this->ClOptions[config]->UsingUnicode()) ||
|
this->ClOptions[config]->UsingUnicode()) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user