MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / DefineGroup

Function DefineGroup

tools/building.py:565–682  ·  view source on GitHub ↗
(name, src, depend, **parameters)

Source from the content-addressed store, hash-verified

563 return True # permit to add this list to the parameter
564
565def DefineGroup(name, src, depend, **parameters):
566 global Env
567 if not GetDepend(depend):
568 return []
569
570 # find exist group and get path of group
571 group_path = ''
572 for g in Projects:
573 if g['name'] == name:
574 group_path = g['path']
575 if group_path == '':
576 group_path = GetCurrentDir()
577
578 group = parameters
579 group['name'] = name
580 group['path'] = group_path
581 if type(src) == type([]):
582 # remove duplicate elements from list
583 src = list(set(src))
584 group['src'] = File(src)
585 else:
586 group['src'] = src
587
588 if 'CFLAGS' in group:
589 target = group['CFLAGS']
590 if len(target) > 0:
591 Env.AppendUnique(CFLAGS = target)
592 if 'CCFLAGS' in group:
593 target = group['CCFLAGS']
594 if len(target) > 0:
595 Env.AppendUnique(CCFLAGS = target)
596 if 'CXXFLAGS' in group:
597 target = group['CXXFLAGS']
598 if len(target) > 0:
599 Env.AppendUnique(CXXFLAGS = target)
600 if 'CPPPATH' in group:
601 target = group['CPPPATH']
602 if _PretreatListParameters(target) == True:
603 paths = []
604 for item in target:
605 paths.append(os.path.abspath(item))
606 target = paths
607 Env.AppendUnique(CPPPATH = target)
608 if 'CPPDEFINES' in group:
609 target = group['CPPDEFINES']
610 if _PretreatListParameters(target) == True:
611 Env.AppendUnique(CPPDEFINES = target)
612 if 'LINKFLAGS' in group:
613 target = group['LINKFLAGS']
614 if len(target) > 0:
615 Env.AppendUnique(LINKFLAGS = target)
616 if 'ASFLAGS' in group:
617 target = group['ASFLAGS']
618 if len(target) > 0:
619 Env.AppendUnique(ASFLAGS = target)
620 if 'LOCAL_CPPPATH' in group:
621 paths = []
622 for item in group['LOCAL_CPPPATH']:

Callers 2

PrepareBuildingFunction · 0.70
BuildPackageFunction · 0.70

Calls 9

FileClass · 0.85
_PretreatListParametersFunction · 0.85
GroupLibFullNameFunction · 0.85
MergeGroupFunction · 0.85
PriorityInsertGroupFunction · 0.85
GetDependFunction · 0.70
GetCurrentDirFunction · 0.70
setFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected