Skip to content

Commit

Permalink
Makes headersCheckingMode STRICT by default in CcCompilationHelper
Browse files Browse the repository at this point in the history
This is to prevent any new rule from having LOOSE when not calling
setHdrsCheckingMode explicitly.

RELNOTES:none
PiperOrigin-RevId: 344559451
  • Loading branch information
oquenchil authored and copybara-github committed Nov 27, 2020
1 parent bb9631e commit 0999cf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public CcCompilationContext getCcCompilationContext() {
private final List<PathFragment> includeDirs = new ArrayList<>();
private final List<PathFragment> frameworkIncludeDirs = new ArrayList<>();

private HeadersCheckingMode headersCheckingMode = HeadersCheckingMode.LOOSE;
private HeadersCheckingMode headersCheckingMode = HeadersCheckingMode.STRICT;

private final SourceCategory sourceCategory;
private final List<VariablesExtension> variablesExtensions = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.FeatureConfiguration;
import com.google.devtools.build.lib.rules.cpp.CcToolchainProvider;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration.HeadersCheckingMode;
import com.google.devtools.build.lib.rules.cpp.CppHelper;
import com.google.devtools.build.lib.rules.cpp.CppRuleClasses;
import com.google.devtools.build.lib.rules.cpp.CppSemantics;
Expand Down Expand Up @@ -330,7 +331,8 @@ private CcCompilationHelper initializeCompilationHelper(
.addCcCompilationContexts(CppHelper.getCompilationContextsFromDeps(deps))
.addCcCompilationContexts(
ImmutableList.of(CcCompilationHelper.getStlCcCompilationContext(ruleContext)))
.setPurpose(common.getPurpose(cppSemantics));
.setPurpose(common.getPurpose(cppSemantics))
.setHeadersCheckingMode(HeadersCheckingMode.LOOSE);
// Don't instrument the generated C++ files even when --collect_code_coverage is set.
helper.setCodeCoverageEnabled(false);

Expand Down

0 comments on commit 0999cf1

Please sign in to comment.