Skip to content

Commit

Permalink
Don't create a C++ module if there are no modular headers. A module w…
Browse files Browse the repository at this point in the history
…ithout any

modular headers does not provide value.

RELNOTES: None.
PiperOrigin-RevId: 351366029
  • Loading branch information
djasper authored and copybara-github committed Jan 12, 2021
1 parent 9aea806 commit 09cba3b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,8 @@ private boolean getGeneratesNoPicHeaderModule() {

/** @return whether we want to provide header modules for the current target. */
private boolean shouldProvideHeaderModules() {
return featureConfiguration.isEnabled(CppRuleClasses.HEADER_MODULES);
return featureConfiguration.isEnabled(CppRuleClasses.HEADER_MODULES)
&& (!publicHeaders.isEmpty() || !privateHeaders.isEmpty());
}

/** @return the no-PIC header module artifact for the current target. */
Expand Down

0 comments on commit 09cba3b

Please sign in to comment.