Selaa lähdekoodia

VS: Fix vcxproj specification of empty output file extension

When a binary output file is to have no extension, the TargetExt
element in the vcxproj cannot be left empty because VS will choose
a default extension.  Instead use "." because the Windows filesystem
will treat that as an empty extension.
Brad King 11 vuotta sitten
vanhempi
sitoutus
2b3e7b6f94
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 6 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -1277,6 +1277,12 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 
 
       std::string ext =
       std::string ext =
         cmSystemTools::GetFilenameLastExtension(targetNameFull);
         cmSystemTools::GetFilenameLastExtension(targetNameFull);
+      if(ext.empty())
+        {
+        // An empty TargetExt causes a default extension to be used.
+        // A single "." appears to be treated as an empty extension.
+        ext = ".";
+        }
       this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
       this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
       *this->BuildFileStream << cmVS10EscapeXML(ext) << "</TargetExt>\n";
       *this->BuildFileStream << cmVS10EscapeXML(ext) << "</TargetExt>\n";