2121 "env_entry" ,
2222 "env_set" ,
2323 "feature" ,
24- "feature_set" ,
2524 "flag_group" ,
2625 "flag_set" ,
2726 "tool" ,
@@ -135,7 +134,6 @@ def _impl(ctx):
135134 "output_execpath_flags" ,
136135 "input_param_flags" ,
137136 "user_link_flags" ,
138- "default_link_flags" ,
139137 "linker_subsystem_flag" ,
140138 "linker_param_file" ,
141139 "msvc_env" ,
@@ -187,13 +185,11 @@ def _impl(ctx):
187185 implies = [
188186 "compiler_input_flags" ,
189187 "compiler_output_flags" ,
190- "default_compile_flags" ,
191188 "nologo" ,
192189 "msvc_env" ,
193190 "parse_showincludes" ,
194191 "user_compile_flags" ,
195192 "sysroot" ,
196- "unfiltered_compile_flags" ,
197193 ],
198194 tools = [tool (path = ctx .attr .msvc_cl_path )],
199195 )
@@ -219,13 +215,11 @@ def _impl(ctx):
219215 implies = [
220216 "compiler_input_flags" ,
221217 "compiler_output_flags" ,
222- "default_compile_flags" ,
223218 "nologo" ,
224219 "msvc_env" ,
225220 "parse_showincludes" ,
226221 "user_compile_flags" ,
227222 "sysroot" ,
228- "unfiltered_compile_flags" ,
229223 ],
230224 tools = [tool (path = ctx .attr .msvc_cl_path )],
231225 )
@@ -238,7 +232,6 @@ def _impl(ctx):
238232 "output_execpath_flags" ,
239233 "input_param_flags" ,
240234 "user_link_flags" ,
241- "default_link_flags" ,
242235 "linker_subsystem_flag" ,
243236 "linker_param_file" ,
244237 "msvc_env" ,
@@ -256,7 +249,6 @@ def _impl(ctx):
256249 "output_execpath_flags" ,
257250 "input_param_flags" ,
258251 "user_link_flags" ,
259- "default_link_flags" ,
260252 "linker_subsystem_flag" ,
261253 "linker_param_file" ,
262254 "msvc_env" ,
@@ -356,6 +348,7 @@ def _impl(ctx):
356348
357349 unfiltered_compile_flags_feature = feature (
358350 name = "unfiltered_compile_flags" ,
351+ enabled = True ,
359352 flag_sets = [
360353 flag_set (
361354 actions = [
@@ -540,21 +533,57 @@ def _impl(ctx):
540533 ],
541534 )
542535
543- static_link_msvcrt_feature = feature (name = "static_link_msvcrt" )
536+ static_link_msvcrt_feature = feature (
537+ name = "static_link_msvcrt" ,
538+ flag_sets = [
539+ flag_set (
540+ actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
541+ flag_groups = [flag_group (flags = ["/MT" ])],
542+ with_features = [with_feature_set (not_features = ["dbg" ])],
543+ ),
544+ flag_set (
545+ actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
546+ flag_groups = [flag_group (flags = ["/MTd" ])],
547+ with_features = [with_feature_set (features = ["dbg" ])],
548+ ),
549+ flag_set (
550+ actions = all_link_actions ,
551+ flag_groups = [flag_group (flags = ["/DEFAULTLIB:libcmt.lib" ])],
552+ with_features = [with_feature_set (not_features = ["dbg" ])],
553+ ),
554+ flag_set (
555+ actions = all_link_actions ,
556+ flag_groups = [flag_group (flags = ["/DEFAULTLIB:libcmtd.lib" ])],
557+ with_features = [with_feature_set (features = ["dbg" ])],
558+ ),
559+ ],
560+ )
544561
545- dynamic_link_msvcrt_debug_feature = feature (
546- name = "dynamic_link_msvcrt_debug" ,
562+ dynamic_link_msvcrt_feature = feature (
563+ name = "dynamic_link_msvcrt" ,
564+ enabled = True ,
547565 flag_sets = [
566+ flag_set (
567+ actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
568+ flag_groups = [flag_group (flags = ["/MD" ])],
569+ with_features = [with_feature_set (not_features = ["dbg" , "static_link_msvcrt" ])],
570+ ),
548571 flag_set (
549572 actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
550573 flag_groups = [flag_group (flags = ["/MDd" ])],
574+ with_features = [with_feature_set (features = ["dbg" ], not_features = ["static_link_msvcrt" ])],
575+ ),
576+ flag_set (
577+ actions = all_link_actions ,
578+ flag_groups = [flag_group (flags = ["/DEFAULTLIB:msvcrt.lib" ])],
579+ with_features = [with_feature_set (not_features = ["dbg" , "static_link_msvcrt" ])],
551580 ),
552581 flag_set (
553582 actions = all_link_actions ,
554583 flag_groups = [flag_group (flags = ["/DEFAULTLIB:msvcrtd.lib" ])],
584+ with_features = [with_feature_set (features = ["dbg" ], not_features = ["static_link_msvcrt" ])],
555585 ),
556586 ],
557- requires = [feature_set (features = ["dbg" ])],
558587 )
559588
560589 dbg_feature = feature (
@@ -709,24 +738,6 @@ def _impl(ctx):
709738 ],
710739 )
711740
712- dynamic_link_msvcrt_no_debug_feature = feature (
713- name = "dynamic_link_msvcrt_no_debug" ,
714- flag_sets = [
715- flag_set (
716- actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
717- flag_groups = [flag_group (flags = ["/MD" ])],
718- ),
719- flag_set (
720- actions = all_link_actions ,
721- flag_groups = [flag_group (flags = ["/DEFAULTLIB:msvcrt.lib" ])],
722- ),
723- ],
724- requires = [
725- feature_set (features = ["fastbuild" ]),
726- feature_set (features = ["opt" ]),
727- ],
728- )
729-
730741 disable_assertions_feature = feature (
731742 name = "disable_assertions" ,
732743 enabled = True ,
@@ -791,24 +802,6 @@ def _impl(ctx):
791802 ],
792803 )
793804
794- static_link_msvcrt_no_debug_feature = feature (
795- name = "static_link_msvcrt_no_debug" ,
796- flag_sets = [
797- flag_set (
798- actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
799- flag_groups = [flag_group (flags = ["/MT" ])],
800- ),
801- flag_set (
802- actions = all_link_actions ,
803- flag_groups = [flag_group (flags = ["/DEFAULTLIB:libcmt.lib" ])],
804- ),
805- ],
806- requires = [
807- feature_set (features = ["fastbuild" ]),
808- feature_set (features = ["opt" ]),
809- ],
810- )
811-
812805 treat_warnings_as_errors_feature = feature (
813806 name = "treat_warnings_as_errors" ,
814807 flag_sets = [
@@ -887,21 +880,6 @@ def _impl(ctx):
887880 ],
888881 )
889882
890- static_link_msvcrt_debug_feature = feature (
891- name = "static_link_msvcrt_debug" ,
892- flag_sets = [
893- flag_set (
894- actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
895- flag_groups = [flag_group (flags = ["/MTd" ])],
896- ),
897- flag_set (
898- actions = all_link_actions ,
899- flag_groups = [flag_group (flags = ["/DEFAULTLIB:libcmtd.lib" ])],
900- ),
901- ],
902- requires = [feature_set (features = ["dbg" ])],
903- )
904-
905883 frame_pointer_feature = feature (
906884 name = "frame_pointer" ,
907885 flag_sets = [
@@ -1105,10 +1083,7 @@ def _impl(ctx):
11051083 default_link_flags_feature ,
11061084 linker_param_file_feature ,
11071085 static_link_msvcrt_feature ,
1108- static_link_msvcrt_no_debug_feature ,
1109- dynamic_link_msvcrt_no_debug_feature ,
1110- static_link_msvcrt_debug_feature ,
1111- dynamic_link_msvcrt_debug_feature ,
1086+ dynamic_link_msvcrt_feature ,
11121087 dbg_feature ,
11131088 fastbuild_feature ,
11141089 opt_feature ,
0 commit comments