Exemplo n.º 1
0
    def build_package_group(self, group):
        relpath = os.path.relpath(group.path, self.build_config.root_path)
        group_node = self.ctx.path.make_node(relpath)
        flags = group.flags
        internal_dep = [d + '_lib' for d in sorted(group.dep)]
        external_dep = [l.upper() for l in sorted(group.external_dep)]

        lib_install_path = self.install_config.get_lib_install_path(group.name)

        # Create task generators in topological order so that the actual task
        # build order would appear to be meaningful.
        ordered_package_names = graphutil.topological_sort(
            buildconfigutil.get_package_digraph(self.build_config, group.name))

        for package_name in ordered_package_names:
            package = self.build_config.inner_packages[package_name]
            self.build_inner_package(package, group)

        if group.name in self.build_config.soname_overrides:
            custom_soname = self.build_config.soname_overrides[group.name]
        else:
            custom_soname = None

        self.gen_pc_file(group)
        self.ctx(name=group.name + '_lib',
                 path=group_node,
                 target=self.install_config.get_target_name(group.name),
                 features=['cxx'] + self.libtype_features,
                 linkflags=flags.linkflags,
                 lib=flags.libs,
                 stlib=flags.stlibs,
                 cust_libpaths=flags.libpaths,
                 source=[p + '_lib' for p in ordered_package_names],
                 use=internal_dep,
                 uselib=external_dep,
                 export_includes=[group_node.make_node(p) for p in
                                  ordered_package_names],
                 install_path=lib_install_path,
                 bdevnum=group.version,
                 bdesoname=custom_soname,
                 depends_on=[group.name + '_pc'],
                 idx=self.global_taskgen_idx
                 )

        self.ctx(
            name=group.name,
            depends_on=[group.name + '_lib'] +
            [p + '_tst' for p in ordered_package_names]
        )
Exemplo n.º 2
0
    def build_package_group(self, group):
        relpath = os.path.relpath(group.path, self.build_config.root_path)
        group_node = self.ctx.path.make_node(relpath)
        flags = group.flags
        internal_dep = [d + '_lib' for d in sorted(group.dep)]
        external_dep = [l.upper() for l in sorted(group.external_dep)]

        lib_install_path = self.install_config.get_lib_install_path(group.name)

        # Create task generators in topological order so that the actual task
        # build order would appear to be meaningful.
        ordered_package_names = graphutil.topological_sort(
            buildconfigutil.get_package_digraph(self.build_config, group.name))

        for package_name in ordered_package_names:
            package = self.build_config.inner_packages[package_name]
            self.build_inner_package(package, group)

        if group.name in self.build_config.soname_overrides:
            custom_soname = self.build_config.soname_overrides[group.name]
        else:
            custom_soname = None

        self.gen_pc_file(group)
        self.ctx(name=group.name + '_lib',
                 path=group_node,
                 target=self.install_config.get_target_name(group.name),
                 features=['cxx'] + self.libtype_features,
                 linkflags=flags.linkflags,
                 lib=flags.libs,
                 stlib=flags.stlibs,
                 cust_libpaths=flags.libpaths,
                 source=[p + '_lib' for p in ordered_package_names],
                 use=internal_dep,
                 uselib=external_dep,
                 export_includes=[
                     group_node.make_node(p) for p in ordered_package_names
                 ],
                 install_path=lib_install_path,
                 bdevnum=group.version,
                 bdesoname=custom_soname,
                 depends_on=[group.name + '_pc'],
                 idx=self.global_taskgen_idx)

        self.ctx(name=group.name,
                 depends_on=[group.name + '_lib'] +
                 [p + '_tst' for p in ordered_package_names])
Exemplo n.º 3
0
    def build(self):
        if not self.ctx.targets or self.ctx.targets == '*':
            digraph = buildconfigutil.get_uor_digraph(self.build_config)
            self.draw_imp(digraph, 'UORs', '__all__')
            return
        elif self.ctx.targets in self.build_config.package_groups:
            group_name = self.ctx.targets
            digraph = buildconfigutil.get_package_digraph(
                self.build_config, group_name)
            self.draw_imp(digraph, group_name, group_name)
            return

        package = None
        if self.ctx.targets in self.build_config.stdalone_packages:
            package = self.build_config.stdalone_packages[self.ctx.targets]
        elif self.ctx.targets in self.build_config.inner_packages:
            package = self.build_config.inner_packages[self.ctx.targets]

        if not package or package.type_ == repounits.PackageType.PACKAGE_PLUS:
            Logs.warn('Graph target must be either empty, '
                      'a package group, or a package that is not '
                      'a + package.')
            return

        digraph = cpreproc.get_component_digraph(
            package, self.ctx.options.use_test_only == 'yes')
        prefix = package.name + '_'

        def remove_prefix(str_):
            if str_.startswith(prefix):
                return str_[len(prefix):]
            return str_

        # Remove prefix
        digraph_new = {}
        for node in digraph:
            digraph_new[remove_prefix(node)] = [
                remove_prefix(c) for c in digraph[node]
            ]

        self.draw_imp(digraph_new, package.name, package.name)
Exemplo n.º 4
0
    def build(self):
        if not self.ctx.targets or self.ctx.targets == '*':
            digraph = buildconfigutil.get_uor_digraph(
                self.build_config)
            self.draw_imp(digraph, 'UORs', '__all__')
            return
        elif self.ctx.targets in self.build_config.package_groups:
            group_name = self.ctx.targets
            digraph = buildconfigutil.get_package_digraph(
                self.build_config, group_name)
            self.draw_imp(digraph, group_name, group_name)
            return

        package = None
        if self.ctx.targets in self.build_config.stdalone_packages:
            package = self.build_config.stdalone_packages[self.ctx.targets]
        elif self.ctx.targets in self.build_config.inner_packages:
            package = self.build_config.inner_packages[self.ctx.targets]

        if not package or package.type_ == repounits.PackageType.PACKAGE_PLUS:
            Logs.warn('Graph target must be either empty, '
                      'a package group, or a package that is not '
                      'a + package.')
            return

        digraph = cpreproc.get_component_digraph(
            package, self.ctx.options.use_test_only == 'yes')
        prefix = package.name + '_'

        def remove_prefix(str_):
            if str_.startswith(prefix):
                return str_[len(prefix):]
            return str_

        # Remove prefix
        digraph_new = {}
        for node in digraph:
            digraph_new[remove_prefix(node)] = [remove_prefix(c) for
                                                c in digraph[node]]

        self.draw_imp(digraph_new, package.name, package.name)