Commit b520b18c authored by Brad King's avatar Brad King 💬
Browse files

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
parent 73038a85
......@@ -982,19 +982,21 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
const char* mfcFlag =
this->GeneratorTarget->Target->GetMakefile()->GetDefinition(
"CMAKE_MFC_FLAG");
std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
if (mfcFlag) {
std::string const mfcFlagValue = mfcFlag;
std::string useOfMfcValue = "false";
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
if (mfcFlagValue == "1") {
useOfMfcValue = "Static";
} else if (mfcFlagValue == "2") {
useOfMfcValue = "Dynamic";
std::string useOfMfcValue = "false";
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
if (mfcFlagValue == "1") {
useOfMfcValue = "Static";
} else if (mfcFlagValue == "2") {
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 &&
this->ClOptions[config]->UsingUnicode()) ||
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment