@@ -9,7 +9,7 @@ load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")
99load ("@rules_cc//cc/common:cc_info.bzl" , "CcInfo" )
1010load ("//rust:defs.bzl" , "rust_binary" , "rust_common" , "rust_library" , "rust_proc_macro" , "rust_shared_library" , "rust_static_library" )
1111
12- def _is_dylib_on_windows (ctx ):
12+ def _is_windows (ctx ):
1313 return ctx .target_platform_has_constraint (ctx .attr ._windows [platform_common .ConstraintValueInfo ])
1414
1515def _assert_cc_info_has_library_to_link (env , tut , type , ccinfo_count ):
@@ -28,7 +28,7 @@ def _assert_cc_info_has_library_to_link(env, tut, type, ccinfo_count):
2828
2929 if type == "cdylib" :
3030 asserts .true (env , library_to_link .dynamic_library != None )
31- if _is_dylib_on_windows (env .ctx ):
31+ if _is_windows (env .ctx ):
3232 asserts .true (env , library_to_link .interface_library != None )
3333 asserts .true (env , library_to_link .resolved_symlink_dynamic_library == None )
3434 else :
@@ -59,8 +59,10 @@ def _rlib_provides_cc_info_test_impl(ctx):
5959 tut = analysistest .target_under_test (env )
6060
6161 count = 4
62+ if _is_windows (env .ctx ):
63+ count -= 1
6264 if ctx .attr ._experimental_use_allocator_libraries_with_mangled_symbols [BuildSettingInfo ].value :
63- count = 3
65+ count -= 1
6466
6567 _assert_cc_info_has_library_to_link (env , tut , "rlib" , count )
6668 return analysistest .end (env )
@@ -114,6 +116,7 @@ def _crate_group_info_provides_cc_info_test_impl(ctx):
114116rlib_provides_cc_info_test = analysistest .make (
115117 _rlib_provides_cc_info_test_impl ,
116118 attrs = {
119+ "_windows" : attr .label (default = Label ("@platforms//os:windows" )),
117120 "_experimental_use_allocator_libraries_with_mangled_symbols" : attr .label (
118121 default = Label ("//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols" ),
119122 ),
0 commit comments