Changeset d797c5d in rtems-libbsd for builder.py


Ignore:
Timestamp:
Mar 26, 2018, 4:14:53 AM (19 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, 4a77611a223ea883fb548679b516d326a020d447
Children:
a6a6d54
Parents:
f7a09b5
git-author:
Chris Johns <chrisj@…> (03/26/18 04:14:53)
git-committer:
Christian Mauderer <christian.mauderer@…> (04/10/18 06:54:58)
Message:

waf: Refactor libbsd.py to support per module generation.

This change allows us to control the modules we want to build.

Update #3351

File:
1 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    rf7a09b5 rd797c5d  
    485485#
    486486class Module(object):
    487     def __init__(self, name):
     487    def __init__(self, manager, name, enabled = True):
     488        self.manager = manager
    488489        self.name = name
     490        self.enabled = enabled
    489491        self.conditionalOn = "none"
    490492        self.files = []
    491493        self.cpuDependentSourceFiles = {}
    492494        self.dependencies = []
     495
     496    def isEnabled(self):
     497        return self.enabled
    493498
    494499    def initCPUDependencies(self, cpu):
     
    640645        return self.modules[key]
    641646
    642     def getModules(self):
    643         return sorted(self.modules.keys())
     647    def getAllModules(self):
     648        if 'modules' in self.configuration:
     649            return self.configuration['modules']
     650        return []
     651
     652    def getEnabledModules(self):
     653        if 'modules-enabled' in self.configuration:
     654            return self.configuration['modules-enabled']
     655        return []
    644656
    645657    def addModule(self, module):
     
    657669    def getConfiguration(self):
    658670        return self.configuration
     671
     672    def setModuleConfigiuration(self):
     673        mods = sorted(self.modules.keys())
     674        self.configuration['modules'] = mods
     675        self.configuration['modules-enabled'] = [m for m in mods if self.modules[m].isEnabled()]
     676
     677    def generateBuild(self):
     678        for m in self.getEnabledModules():
     679            self.modules[m].generate()
Note: See TracChangeset for help on using the changeset viewer.