Parcourir la source

Fix MFC setting on utility targets (#15867)

Multi-byte MFC is deprecated, and some projects will not compile if MFC is enabled.
Clinton Stimpson il y a 9 ans
Parent
commit
a15e375cdd
1 fichiers modifiés avec 9 ajouts et 6 suppressions
  1. 9 6
      Source/cmVisualStudio10TargetGenerator.cxx

+ 9 - 6
Source/cmVisualStudio10TargetGenerator.cxx

@@ -762,13 +762,16 @@ void cmVisualStudio10TargetGenerator
   std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
 
   std::string useOfMfcValue = "false";
-  if(mfcFlagValue == "1")
-    {
-    useOfMfcValue = "Static";
-    }
-  else if(mfcFlagValue == "2")
+  if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY)
     {
-    useOfMfcValue = "Dynamic";
+    if(mfcFlagValue == "1")
+      {
+      useOfMfcValue = "Static";
+      }
+    else if(mfcFlagValue == "2")
+      {
+      useOfMfcValue = "Dynamic";
+      }
     }
   std::string mfcLine = "<UseOfMfc>";
   mfcLine += useOfMfcValue + "</UseOfMfc>\n";