export: Explicitly allow empty NAMESPACE

Modify argument handling in `HandleExportMode` to explicitly allow an
empty `NAMESPACE`. In practice, this was already the case because we
weren't actually checking for the parsing errors that would cause the
`NonEmpty` decoration to reject an empty value, but we want to be able
to do that going forward, and changing the behavior for `NAMESPACE`
would potentially break legitimate uses. (In particular, one of our unit
tests relies on the current behavior.)
This commit is contained in:
Matthew Woehlke
2025-12-01 13:07:01 -05:00
committed by Brad King
parent 5564c2cd9a
commit 2e71df0156

View File

@@ -212,7 +212,7 @@ static bool HandleExportMode(std::vector<std::string> const& args,
struct ExportArguments
{
ArgumentParser::NonEmpty<std::string> ExportSetName;
ArgumentParser::NonEmpty<std::string> Namespace;
ArgumentParser::MaybeEmpty<std::string> Namespace;
ArgumentParser::NonEmpty<std::string> Filename;
ArgumentParser::NonEmpty<std::string> CxxModulesDirectory;
cm::optional<cmPackageInfoArguments> PackageInfo;