Exemplo n.º 1
0
    def process(self, target, matches, binding):
        included_angle = regex.transform(matches, self.re_include_angle)
        included_quoted = regex.transform(matches, self.re_include_quoted)
        imported = regex.transform(matches, self.re_import, [1, 3])
        imported_tlbs = regex.transform(matches, self.re_importlib, [1, 3])

        # CONSIDER: the new scoping rule seem to defeat "on target" variables.
        g = bjam.call('get-target-variable', target, 'HDRGRIST')[0]
        b = os.path.normpath(os.path.dirname(binding))

        # Attach binding of including file to included targets.
        # When target is directly created from virtual target
        # this extra information is unnecessary. But in other
        # cases, it allows to distinguish between two headers of the
        # same name included from different places.
        g2 = g + "#" + b

        g = "<" + g + ">"
        g2 = "<" + g2 + ">"

        included_angle = [g + x for x in included_angle]
        included_quoted = [g + x for x in included_quoted]
        imported = [g + x for x in imported]
        imported_tlbs = [g + x for x in imported_tlbs]

        all = included_angle + included_quoted + imported

        bjam.call('INCLUDES', [target], all)
        bjam.call('DEPENDS', [target], imported_tlbs)
        bjam.call('NOCARE', all + imported_tlbs)
        engine.set_target_variable(
            included_angle, 'SEARCH',
            [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(
            included_quoted, 'SEARCH',
            [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(
            imported, 'SEARCH',
            [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(
            imported_tlbs, 'SEARCH',
            [utility.get_value(inc) for inc in self.includes])

        get_manager().scanners().propagate(
            type.get_scanner('CPP', PropertySet(self.includes)),
            included_angle + included_quoted)
        get_manager().scanners().propagate(self, imported)
Exemplo n.º 2
0
    def actualize_source_type (self, sources, prop_set):
        """ Helper for 'actualize_sources'.
            For each passed source, actualizes it with the appropriate scanner.
            Returns the actualized virtual targets.
        """
        result = []
        for i in sources:
            scanner = None

# FIXME: what's this?
#            if isinstance (i, str):
#                i = self.manager_.get_object (i)
                
            if i.type ():
                scanner = type.get_scanner (i.type (), prop_set)

            result.append (i.actualize (scanner))
        
        return result
Exemplo n.º 3
0
    def actualize_source_type (self, sources, prop_set):
        """ Helper for 'actualize_sources'.
            For each passed source, actualizes it with the appropriate scanner.
            Returns the actualized virtual targets.
        """
        result = []
        for i in sources:
            scanner = None

# FIXME: what's this?
#            if isinstance (i, str):
#                i = self.manager_.get_object (i)
                
            if i.type ():
                scanner = type.get_scanner (i.type (), prop_set)

            result.append (i.actualize (scanner))
        
        return result
Exemplo n.º 4
0
    def process(self, target, matches, binding):
        included_angle = regex.transform(matches, self.re_include_angle)
        included_quoted = regex.transform(matches, self.re_include_quoted)
        imported = regex.transform(matches, self.re_import, [1, 3])
        imported_tlbs = regex.transform(matches, self.re_importlib, [1, 3])

        # CONSIDER: the new scoping rule seem to defeat "on target" variables.
        g = bjam.call("get-target-variable", target, "HDRGRIST")[0]
        b = os.path.normpath(os.path.dirname(binding))

        # Attach binding of including file to included targets.
        # When target is directly created from virtual target
        # this extra information is unnecessary. But in other
        # cases, it allows to distinguish between two headers of the
        # same name included from different places.
        g2 = g + "#" + b

        g = "<" + g + ">"
        g2 = "<" + g2 + ">"

        included_angle = [g + x for x in included_angle]
        included_quoted = [g + x for x in included_quoted]
        imported = [g + x for x in imported]
        imported_tlbs = [g + x for x in imported_tlbs]

        all = included_angle + included_quoted + imported

        bjam.call("INCLUDES", [target], all)
        bjam.call("DEPENDS", [target], imported_tlbs)
        bjam.call("NOCARE", all + imported_tlbs)
        engine.set_target_variable(included_angle, "SEARCH", [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(included_quoted, "SEARCH", [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(imported, "SEARCH", [utility.get_value(inc) for inc in self.includes])
        engine.set_target_variable(imported_tlbs, "SEARCH", [utility.get_value(inc) for inc in self.includes])

        get_manager().scanners().propagate(
            type.get_scanner("CPP", PropertySet(self.includes)), included_angle + included_quoted
        )
        get_manager().scanners().propagate(self, imported)