Merge topic 'install-object-names-build-short'

b2ebfd7709 shortobj: properly force long names when computing long names
1980e47192 Tests/IntermediateDirStrategy: test install paths when using SHORT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11201
This commit is contained in:
Brad King
2025-09-18 12:36:00 +00:00
committed by Kitware Robot
8 changed files with 59 additions and 2 deletions

View File

@@ -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.

View File

@@ -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);