mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
target_sources(): Enforce stricter requirements for FILE_SET name
Fixes: #23286
This commit is contained in:
@@ -215,9 +215,10 @@ bool TargetSourcesImpl::HandleFileSetMode(
|
||||
auto fileSet = this->Target->GetOrCreateFileSet(args.FileSet, type);
|
||||
if (fileSet.second) {
|
||||
if (!isDefault) {
|
||||
if (args.FileSet[0] >= 'A' && args.FileSet[0] <= 'Z') {
|
||||
this->SetError(
|
||||
"Non-default file set name must not start with a capital letter");
|
||||
if (!cmFileSet::IsValidName(args.FileSet)) {
|
||||
this->SetError("Non-default file set name must contain only letters, "
|
||||
"numbers, and underscores, and must not start with a "
|
||||
"capital letter or underscore");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user