From 8bb949fc30677ea7a5c71b91f176dbbb12f15d5c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 Oct 2023 10:53:28 -0400 Subject: source_group: Restore behavior of TREE with empty FILES Since commit d85238a2f2 (source_group: Fix TREE without FILES, 2023-06-29, v3.28.0-rc1~399^2~1) we incorrectly treat a FILES argument with no values as if it were not given at all. Fixes: #25353 --- Source/cmSourceGroupCommand.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 4b1685f..bb92856 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -280,8 +280,11 @@ static bool processTree(cmMakefile& mf, ParsedArguments& parsedArguments, ? "" : parsedArguments[kPrefixOptionName].front(); - std::vector files = parsedArguments[kFilesOptionName]; - if (files.empty()) { + std::vector files; + auto filesArgIt = parsedArguments.find(kFilesOptionName); + if (filesArgIt != parsedArguments.end()) { + files = filesArgIt->second; + } else { const std::vector>& srcFiles = mf.GetSourceFiles(); for (const auto& srcFile : srcFiles) { -- cgit v0.12