diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ec9cd1a8ca..50a55d849b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -4507,7 +4507,7 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget( } // Strip source file extension when shortening object file paths - if (this->UseShortObjectNames()) { + if (useShortObjectNames) { objectName = cmSystemTools::GetFilenameWithoutExtension(objectName); } // Store the new extension. diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index c45a957976..b699e1f698 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -99,8 +99,9 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( if (counts[cmSystemTools::LowerCase(longObjectName)] > 1) { const_cast(gt)->AddExplicitObjectName(sf); bool keptSourceExtension; + bool forceShortObjectName = false; longObjectName = this->GetObjectFileNameWithoutTarget( - *sf, dir_max, &keptSourceExtension, custom_ext); + *sf, dir_max, &keptSourceExtension, custom_ext, &forceShortObjectName); } si.second.ShortLoc.emplace(shortObjectName); si.second.LongLoc.Update(longObjectName);