mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-23 23:18:38 -06:00
fileAPI: Silently ignore non-target order dependencies
Non-target order dependencies should be caught as project errors.
Prior to f38f325e08 (fileAPI: Add direct dependencies to target
codemodel files, 2025-10-04), they were silently ignored, but that
change crashed on such cases. Restore the old behavior of silently
ignoring such project errors and prevent the crash.
Fixes: #27415
This commit is contained in:
@@ -2303,8 +2303,10 @@ Json::Value Target::DumpOrderDependencies()
|
||||
// dependency.
|
||||
Json::Value jsonDependencies = Json::arrayValue;
|
||||
for (cmLinkItem const& linkItem : this->GT->GetUtilityItems()) {
|
||||
// We don't want to dump dependencies on reserved targets like ZERO_CHECK
|
||||
if (linkItem.Target &&
|
||||
// We don't want to dump dependencies on reserved targets like ZERO_CHECK.
|
||||
// We shouldn't see link items that are not targets, but for backward
|
||||
// compatibility reasons, they are currently allowed but silently ignored.
|
||||
if (!linkItem.Target ||
|
||||
cmGlobalGenerator::IsReservedTarget(linkItem.Target->GetName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user