def setup_install_uors(self, targets, is_install_dep, uor_digraph): """Determine install targets. Determine the name of the Units of Release (package groups, stand-alone packages, and third-party directories) to be installed. Args: targets (list of str): The list of install targets. is_install_dep (bool): Whether to also install dependencies of the targets. uor_digraph (dict): The depency graph of UOR names. Raises: blderror.InvalidInstallTargetError """ uors = uor_digraph.keys() if targets: targets = targets.split(',') if any(t not in uors for t in targets): raise blderror.InvalidInstallTargetError( 'Install targets must be UORs (package groups, ' 'stand-alone packages, and third-party directories).') if is_install_dep: self.install_uors = set( graphutil.topological_sort(uor_digraph, targets)) else: self.install_uors = targets else: self.install_uors = uors
def setup_install_uors(self, targets, is_install_dep, uor_digraph): """Determine install targets. Determine the name of the Units of Release (package groups, stand-alone packages, and third-party directories) to be installed. Args: targets (list of str): The list of install targets. is_install_dep (bool): Whether to also install dependencies of the targets. uor_digraph (dict): The depency graph of UOR names. Raises: blderror.InvalidInstallTargetError """ uors = uor_digraph.keys() if targets: targets = targets.split(',') if any(t not in uors for t in targets): raise blderror.InvalidInstallTargetError( 'Install targets must be UORs (package groups, ' 'stand-alone packages, and third-party directories).') if is_install_dep: self.install_uors = set(graphutil.topological_sort( uor_digraph, targets)) else: self.install_uors = targets else: self.install_uors = uors
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] )
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])
def build(self): # Create task generators in topological order so that the actual task # build order would appear to be meaningful. Note that ordering this # not necessary and the build would work for any order of task # generators. ordered_uor_names = graphutil.topological_sort(self.uor_digraph) for uor_name in ordered_uor_names: if uor_name in self.build_config.package_groups: group = self.build_config.package_groups[uor_name] self.build_package_group(group) if uor_name in self.build_config.stdalone_packages: package = self.build_config.stdalone_packages[uor_name] self.build_stdalone_package(package) if uor_name in self.build_config.third_party_dirs: tp = self.build_config.third_party_dirs[uor_name] self.build_thirdparty_dirs(tp)