File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 62
62
"SWIFT_FEATURE_SUPPORTS_LIBRARY_EVOLUTION" ,
63
63
"SWIFT_FEATURE_SUPPORTS_SYSTEM_MODULE_FLAG" ,
64
64
"SWIFT_FEATURE_SYSTEM_MODULE" ,
65
+ "SWIFT_FEATURE_TREAT_WARNINGS_AS_ERRORS" ,
65
66
"SWIFT_FEATURE_USE_C_MODULES" ,
66
67
"SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP" ,
67
68
"SWIFT_FEATURE_USE_GLOBAL_INDEX_STORE" ,
@@ -527,6 +528,19 @@ def compile_action_configs(
527
528
features = [SWIFT_FEATURE_ENABLE_TESTING ],
528
529
),
529
530
531
+ # Enable warnings-as-errors if requested.
532
+ swift_toolchain_config .action_config (
533
+ actions = [
534
+ swift_action_names .COMPILE ,
535
+ swift_action_names .DERIVE_FILES ,
536
+ swift_action_names .DUMP_AST ,
537
+ ],
538
+ configurators = [
539
+ swift_toolchain_config .add_arg ("-warnings-as-errors" ),
540
+ ],
541
+ features = [SWIFT_FEATURE_TREAT_WARNINGS_AS_ERRORS ],
542
+ ),
543
+
530
544
# Set Developer Framework search paths
531
545
swift_toolchain_config .action_config (
532
546
actions = [
Original file line number Diff line number Diff line change @@ -336,3 +336,6 @@ SWIFT_FEATURE__FORCE_ALWAYSLINK_TRUE = "swift._force_alwayslink_true"
336
336
# 5.9 and above). Users should never manually enable, disable, or query this
337
337
# feature.
338
338
SWIFT_FEATURE__SUPPORTS_MACROS = "swift._supports_macros"
339
+
340
+ # Pass -warnings-as-errors to the compiler.
341
+ SWIFT_FEATURE_TREAT_WARNINGS_AS_ERRORS = "swift.treat_warnings_as_errors"
You can’t perform that action at this time.
0 commit comments