@ -762,6 +762,8 @@ class BuildTarget(Target):
self . pch : T . Dict [ str , T . List [ str ] ] = { }
self . pch : T . Dict [ str , T . List [ str ] ] = { }
self . extra_args : T . DefaultDict [ str , T . List [ str ] ] = kwargs . get ( ' language_args ' , defaultdict ( list ) )
self . extra_args : T . DefaultDict [ str , T . List [ str ] ] = kwargs . get ( ' language_args ' , defaultdict ( list ) )
self . sources : T . List [ File ] = [ ]
self . sources : T . List [ File ] = [ ]
# If the same source is defined multiple times, use it only once.
self . seen_sources : T . Set [ File ] = set ( )
self . generated : T . List [ ' GeneratedTypes ' ] = [ ]
self . generated : T . List [ ' GeneratedTypes ' ] = [ ]
self . extra_files : T . List [ File ] = [ ]
self . extra_files : T . List [ File ] = [ ]
self . d_features : DFeatures = {
self . d_features : DFeatures = {
@ -884,12 +886,11 @@ class BuildTarget(Target):
( static as they are only regenerated if meson itself is regenerated )
( static as they are only regenerated if meson itself is regenerated )
3. Sources files generated by another target or a Generator ( generated )
3. Sources files generated by another target or a Generator ( generated )
"""
"""
added_sources : T . Set [ File ] = set ( ) # If the same source is defined multiple times, use it only once.
for s in sources :
for s in sources :
if isinstance ( s , File ) :
if isinstance ( s , File ) :
if s not in added _sources:
if s not in self . seen _sources:
self . sources . append ( s )
self . sources . append ( s )
added _sources. add ( s )
self . seen _sources. add ( s )
elif isinstance ( s , ( CustomTarget , CustomTargetIndex , GeneratedList ) ) :
elif isinstance ( s , ( CustomTarget , CustomTargetIndex , GeneratedList ) ) :
self . generated . append ( s )
self . generated . append ( s )