Genex: Restore REMOVE_DUPLICATES preservation of empty elements

Refactoring in commit 72d116ee68 (GenEx: list oriented genexes use
cmList class, 2023-03-29, v3.27.0-rc1~205^2) accidentally caused
empty elements to be dropped by the `REMOVE_DUPLICATES` genex.
Fix it and add a test case.

Fixes: #25080
This commit is contained in:
Brad King
2023-07-12 11:35:39 -04:00
parent fbe5f49d63
commit 861dd60ecf
4 changed files with 13 additions and 1 deletions

View File

@@ -384,7 +384,9 @@ static const struct RemoveDuplicatesNode : public cmGeneratorExpressionNode
"$<REMOVE_DUPLICATES:...> expression requires one parameter");
}
return cmList{ parameters.front() }.remove_duplicates().to_string();
return cmList{ parameters.front(), cmList::EmptyElements::Yes }
.remove_duplicates()
.to_string();
}
} removeDuplicatesNode;