edje - edje_cc - add no warning for unused images and use it

a test edje has lots of unused images - it's not important so silence
warnings.
This commit is contained in:
Carsten Haitzler 2021-04-16 04:09:06 +01:00
parent aef36c6e5b
commit 5b17444313
4 changed files with 20 additions and 9 deletions

View File

@ -21,6 +21,7 @@ foreach edc_file : edc_files
input : edc_file, input : edc_file,
output : '@BASENAME@.edj', output : '@BASENAME@.edj',
command : edje_cc_exe + [ '-beta', '-fastcomp', command : edje_cc_exe + [ '-beta', '-fastcomp',
'-no-warn-unused-images',
'-sd', elm_themes_sound_include, '-sd', elm_themes_sound_include,
'-id', elm_themes_image_include, '-id', elm_themes_image_include,
'-id', join_paths(meson.current_source_dir()), '-id', join_paths(meson.current_source_dir()),

View File

@ -52,6 +52,7 @@ int annotate = 0;
int no_etc1 = 0; int no_etc1 = 0;
int no_etc2 = 0; int no_etc2 = 0;
int beta = 0; int beta = 0;
int no_warn_unused_images = 0;
Eina_Bool namespace_verify; Eina_Bool namespace_verify;
unsigned int max_open_files; unsigned int max_open_files;
@ -315,6 +316,10 @@ main(int argc, char **argv)
{ {
annotate = 1; annotate = 1;
} }
else if (!strcmp(argv[i], "-no-warn-unused-images"))
{
no_warn_unused_images = 1;
}
else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1))) else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
{ {
i++; i++;

View File

@ -346,6 +346,7 @@ extern int annotate;
extern Eina_Bool current_group_inherit; extern Eina_Bool current_group_inherit;
extern Eina_List *color_tree_root; extern Eina_List *color_tree_root;
extern int beta; extern int beta;
extern int no_warn_unused_images;
extern int had_quote; extern int had_quote;

View File

@ -4038,9 +4038,10 @@ free_group:
if (de->entry && eina_hash_find(images_in_use, de->entry)) if (de->entry && eina_hash_find(images_in_use, de->entry))
continue; continue;
printf("Warning: Image '%s' not used\n", de->entry); if (!no_warn_unused_images)
INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.", printf("Warning: Image '%s' not used\n", de->entry);
de->entry, de->id); // INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
// de->entry, de->id);
// so as not to write the unused images, moved last image in the // so as not to write the unused images, moved last image in the
// list to unused image position and check it // list to unused image position and check it
@ -4069,13 +4070,16 @@ free_group:
if (set->name && eina_hash_find(images_in_use, set->name)) if (set->name && eina_hash_find(images_in_use, set->name))
continue; continue;
printf("Warning: Image set '%s' not used\n", set->name); if (!no_warn_unused_images)
EINA_LIST_FOREACH(set->entries, l, set_e)
{ {
printf(" Contains '%s' size %ix%i -> %ix%i\n", printf("Warning: Image set '%s' not used\n", set->name);
set_e->name, EINA_LIST_FOREACH(set->entries, l, set_e)
set_e->size.min.w, set_e->size.min.h, {
set_e->size.max.w, set_e->size.max.h); printf(" Contains '%s' size %ix%i -> %ix%i\n",
set_e->name,
set_e->size.min.w, set_e->size.min.h,
set_e->size.max.w, set_e->size.max.h);
}
} }
/* No need to redo id's - we will warn of unused images - fix in src /* No need to redo id's - we will warn of unused images - fix in src
* Also .. this is broken and messes up id's ... so easyer - complain * Also .. this is broken and messes up id's ... so easyer - complain