Skip to content

Commit

Permalink
Don't generate headers for empty namespaces (namespaces with only con…
Browse files Browse the repository at this point in the history
…tracts/attributes) (microsoft#124)
  • Loading branch information
kennykerr authored Jan 14, 2019
1 parent 4edcd50 commit d5249b4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/tool/cpp/cppwinrt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ namespace xlang
}
}

static bool has_projected_types(cache::namespace_members const& members)
{
return
!members.interfaces.empty() ||
!members.classes.empty() ||
!members.enums.empty() ||
!members.structs.empty() ||
!members.delegates.empty();
}

static void run(int const argc, char** argv)
{
writer w;
Expand Down Expand Up @@ -182,7 +192,7 @@ namespace xlang
{
group.add([&, &ns = ns, &members = members]
{
if (members.types.empty() || !settings.filter.includes(members))
if (!has_projected_types(members) || !settings.filter.includes(members))
{
return;
}
Expand Down

0 comments on commit d5249b4

Please sign in to comment.