Skip to content

Commit 09cba3b

Browse files
djasper-ghcopybara-github
authored andcommitted
Don't create a C++ module if there are no modular headers. A module without any
modular headers does not provide value. RELNOTES: None. PiperOrigin-RevId: 351366029
1 parent 9aea806 commit 09cba3b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,8 @@ private boolean getGeneratesNoPicHeaderModule() {
12271227

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

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

0 commit comments

Comments
 (0)