mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
shortobj: properly force long names when computing long names
The arguments need to be able to force a long name computation so that install paths can use the intended long paths. Use this computed state rather than asking the generator for its base state. Also force long paths for Visual Studio generators when computing it. Fixes: #27233
This commit is contained in:
@@ -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.
|
||||
|
@@ -99,8 +99,9 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
|
||||
if (counts[cmSystemTools::LowerCase(longObjectName)] > 1) {
|
||||
const_cast<cmGeneratorTarget*>(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);
|
||||
|
Reference in New Issue
Block a user