raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5b174443130d6079d1e02b7985577a52ea215b17

commit 5b174443130d6079d1e02b7985577a52ea215b17
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Apr 16 04:09:06 2021 +0100

    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.
---
 data/elementary/objects/meson.build |  1 +
 src/bin/edje/edje_cc.c              |  5 +++++
 src/bin/edje/edje_cc.h              |  1 +
 src/bin/edje/edje_cc_out.c          | 22 +++++++++++++---------
 4 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/data/elementary/objects/meson.build 
b/data/elementary/objects/meson.build
index c2379ea906..736e6a154d 100644
--- a/data/elementary/objects/meson.build
+++ b/data/elementary/objects/meson.build
@@ -21,6 +21,7 @@ foreach edc_file : edc_files
     input : edc_file,
     output : '@BASENAME@.edj',
     command : edje_cc_exe + [ '-beta', '-fastcomp',
+              '-no-warn-unused-images',
               '-sd', elm_themes_sound_include,
               '-id', elm_themes_image_include,
               '-id', join_paths(meson.current_source_dir()),
diff --git a/src/bin/edje/edje_cc.c b/src/bin/edje/edje_cc.c
index dff3fd7a3e..0362c15f79 100644
--- a/src/bin/edje/edje_cc.c
+++ b/src/bin/edje/edje_cc.c
@@ -52,6 +52,7 @@ int annotate = 0;
 int no_etc1 = 0;
 int no_etc2 = 0;
 int beta = 0;
+int no_warn_unused_images = 0;
 Eina_Bool namespace_verify;
 
 unsigned int max_open_files;
@@ -315,6 +316,10 @@ main(int argc, char **argv)
           {
              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)))
           {
              i++;
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index 580c44fe6d..27338c3540 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -346,6 +346,7 @@ extern int                    annotate;
 extern Eina_Bool current_group_inherit;
 extern Eina_List             *color_tree_root;
 extern int                    beta;
+extern int                    no_warn_unused_images;
 
 extern int had_quote;
 
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index b7a1a1d729..e97a8ec005 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -4038,9 +4038,10 @@ free_group:
              if (de->entry && eina_hash_find(images_in_use, de->entry))
                continue;
 
-             printf("Warning: Image '%s' not used\n", de->entry);
-             INF("Image '%s' in resource 'edje/image/%i' will not be included 
as it is unused.",
-                 de->entry, de->id);
+             if (!no_warn_unused_images)
+               printf("Warning: Image '%s' not used\n", de->entry);
+//             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
              // 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))
                continue;
 
-             printf("Warning: Image set '%s' not used\n", set->name);
-             EINA_LIST_FOREACH(set->entries, l, set_e)
+             if (!no_warn_unused_images)
                {
-                  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);
+                  printf("Warning: Image set '%s' not used\n", set->name);
+                  EINA_LIST_FOREACH(set->entries, l, set_e)
+                    {
+                       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
  * Also .. this is broken and messes up id's ... so easyer - complain

-- 


Reply via email to