SERVER-114971 fix warnings as errors (#44889)

GitOrigin-RevId: a506648363035c57bfd81ed30e435d6cb437251d
This commit is contained in:
Daniel Moody 2025-12-05 15:50:27 -06:00 committed by MongoDB Bot
parent daa4d03290
commit 16253e95d8
2 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,18 @@ def generate_config_header_impl(ctx):
action_name = ACTION_NAMES.cpp_compile,
variables = compile_variables,
)
# The config header generation should not fail due to compiler warnings,
# so remove any flags that would treat warnings as errors.
compiler_flags = [
flag
for flag in compiler_flags
if not (
flag == "-Werror" or
flag.startswith("-Werror") or
flag == "/WX"
)
]
link_flags = cc_common.get_memory_inefficient_command_line(
feature_configuration = feature_configuration,
action_name = ACTION_NAMES.cpp_link_executable,

View File

@ -425,7 +425,7 @@ def get_common_features(ctx):
),
feature(
name = "warnings_as_errors_compile",
enabled = False,
enabled = ctx.attr.warnings_as_errors_enabled,
flag_sets = [
flag_set(
actions = all_compile_actions,