@@ -44,16 +44,17 @@ def subtract_linking_contexts(owner, linking_contexts, avoid_dep_linking_context
44
44
libraries = []
45
45
user_link_flags = []
46
46
additional_inputs = []
47
- non_library_inputs = []
48
47
linkstamps = []
49
48
avoid_library_set = _build_avoid_library_set (avoid_dep_linking_contexts )
49
+ linker_inputs_seen = dict ()
50
50
51
51
for linking_context in linking_contexts :
52
52
for linker_input in linking_context .linker_inputs .to_list ():
53
- if not linker_input .libraries :
54
- non_library_inputs .append (linker_input )
53
+ if linker_input in linker_inputs_seen :
55
54
continue
56
55
56
+ linker_inputs_seen [linker_input ] = True
57
+
57
58
for library_to_link in linker_input .libraries :
58
59
library_artifact = apple_common .compilation_support .get_library_for_linking (library_to_link )
59
60
@@ -65,17 +66,14 @@ def subtract_linking_contexts(owner, linking_contexts, avoid_dep_linking_context
65
66
linkstamps .extend (linker_input .linkstamps )
66
67
67
68
return cc_common .create_linking_context (
68
- linker_inputs = depset (
69
- [
70
- cc_common .create_linker_input (
71
- owner = owner ,
72
- libraries = depset (libraries , order = "topological" ),
73
- user_link_flags = user_link_flags ,
74
- additional_inputs = depset (additional_inputs ),
75
- linkstamps = depset (linkstamps ),
76
- ),
77
- ],
78
- transitive = [depset (non_library_inputs )],
79
- ),
69
+ linker_inputs = depset ([
70
+ cc_common .create_linker_input (
71
+ owner = owner ,
72
+ libraries = depset (libraries , order = "topological" ),
73
+ user_link_flags = user_link_flags ,
74
+ additional_inputs = depset (additional_inputs ),
75
+ linkstamps = depset (linkstamps ),
76
+ ),
77
+ ]),
80
78
owner = owner ,
81
79
)
0 commit comments