def get_target_list(fips_dir, proj_dir, cfg_name): """get project targets config name, only works if a cmake run was performed before :param fips_dir: absolute path to fips :param proj_dir: absolute project path :param cfg_name: the config name :returns: (success, targets) """ configs = config.load(fips_dir, proj_dir, cfg_name) if configs: return util.get_cfg_target_list(fips_dir, proj_dir, configs[0]) else: log.error("No valid configs found for '{}'".format(cfg_name))
def read_cmake_targets(fips_dir, proj_dir, cfg, types): '''Reads the fips_targets.yml file which was created during "fips gen", and extract targets matching the target types in the types array, or if types is None, all targets. ''' success, targets = util.get_cfg_target_list(fips_dir, proj_dir, cfg) if success: if types: matching_targets = [tgt for tgt in targets if targets[tgt] in types] else: matching_targets = targets.keys() return matching_targets else: log.error('Failed to read fips_targets.yml from build dir') return None
def read_cmake_targets(fips_dir, proj_dir, cfg, types): '''Reads the fips_targets.yml file which was created during "fips gen", and extract targets matching the target types in the types array, or if types is None, all targets. ''' success, targets = util.get_cfg_target_list(fips_dir, proj_dir, cfg) if success: if types: matching_targets = [tgt for tgt in targets if targets[tgt] in types] else: matching_targets = targets.keys() return matching_targets else: log.error('Failed to read fips_targets.yml from build dir') return None