diff options
author | Brad King <brad.king@kitware.com> | 2017-05-22 17:16:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-22 17:17:47 (GMT) |
commit | b520b18c733c8ed6036fe6488c27e1ee2630fd97 (patch) | |
tree | 9663533ed840b56c818661ed68be4a3a2bcda3c7 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 73038a85ea5d290bffc40a28ca8fa5a8d74c472c (diff) | |
download | CMake-b520b18c733c8ed6036fe6488c27e1ee2630fd97.zip CMake-b520b18c733c8ed6036fe6488c27e1ee2630fd97.tar.gz CMake-b520b18c733c8ed6036fe6488c27e1ee2630fd97.tar.bz2 |
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
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4fcf5dc..eef6f37 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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()) || |