瀏覽代碼

BUG: Duplicate object name detection should not be case sensitive since this code is used on Windows file systems. This addresses bug#3589.

Brad King 19 年之前
父節點
當前提交
6ad36e407e
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      Source/cmLocalVisualStudioGenerator.cxx

+ 8 - 5
Source/cmLocalVisualStudioGenerator.cxx

@@ -55,7 +55,8 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
   // Clear the current set of requirements.
   this->NeedObjectName.clear();
 
-  // Count the number of object files with each name.
+  // Count the number of object files with each name.  Note that
+  // windows file names are not case sensitive.
   std::map<cmStdString, int> objectNameCounts;
   for(unsigned int i = 0; i < sourceGroups.size(); ++i)
     {
@@ -68,8 +69,9 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
       if(this->SourceFileCompiles(sf))
         {
         std::string objectName =
-          cmSystemTools::GetFilenameWithoutLastExtension(
-            sf->GetFullPath().c_str());
+          cmSystemTools::LowerCase(
+            cmSystemTools::GetFilenameWithoutLastExtension(
+              sf->GetFullPath().c_str()));
         objectName += ".obj";
         objectNameCounts[objectName] += 1;
         }
@@ -89,8 +91,9 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements
       if(this->SourceFileCompiles(sf))
         {
         std::string objectName =
-          cmSystemTools::GetFilenameWithoutLastExtension(
-            sf->GetFullPath().c_str());
+          cmSystemTools::LowerCase(
+            cmSystemTools::GetFilenameWithoutLastExtension(
+              sf->GetFullPath().c_str()));
         objectName += ".obj";
         if(objectNameCounts[objectName] > 1)
           {