(Build) Disable to compile unused modules 04/278804/3
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 26 Jul 2022 07:58:40 +0000 (16:58 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 27 Jul 2022 08:23:14 +0000 (17:23 +0900)
Change-Id: I8185bc5c170c55e7dd575d80409d179caf20d556

build/tizen/configure.ac
build/tizen/dali-extension/Makefile.am
build/tizen/dali-extension/configure.ac
dali-extension/dali-extension.h
dali-extension/image-loader/loader-dummy.cpp [changed mode: 0755->0644]
dali-extension/image-loader/tizen-image-loader.cpp [changed mode: 0755->0644]
packaging/dali-extension.spec

index a0fbbd6..b370622 100755 (executable)
@@ -40,12 +40,35 @@ AC_ARG_ENABLE([web-engine-plugin],
               [enable_web_engine_plugin=$enableval],
               [enable_web_engine_plugin=no])
 
+AC_ARG_ENABLE([imageloader-extension],
+              [AC_HELP_STRING([--enable-imageloader-extension],
+                              [Turns on image loader extension build])],
+              [enable_imageloader_extension=$enableval],
+              [enable_imageloader_extension=no])
+
+AC_ARG_ENABLE([color-controller],
+              [AC_HELP_STRING([--enable-color-controller],
+                              [Turns on color controller plugin build])],
+              [enable_color_controller=$enableval],
+              [enable_color_controller=no])
+
+AC_ARG_ENABLE([evas-plugin],
+              [AC_HELP_STRING([--enable-evas-plugin],
+                              [Turns on evas plugin])],
+              [enable_evas_plugin=$enableval],
+              [enable_evas_plugin=no])
+
 PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit])
 
 AC_CONFIG_SUBDIRS(key)
 AC_CONFIG_SUBDIRS(video-player)
+
+if test "x$enable_imageloader_extension" = "xyes"; then
 AC_CONFIG_SUBDIRS(image-loader)
+fi
+if test "x$enable_color_controller" = "xyes"; then
 AC_CONFIG_SUBDIRS(color-controller)
+fi
 
 if test "x$with_tizen_55_or_greater" = "xyes"; then
   AC_CONFIG_SUBDIRS(vector-animation-renderer)
index 990e570..7623641 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2020 Samsung Electronics Co., Ltd.
+# Copyright (c) 2022 Samsung Electronics Co., Ltd.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 extension_src_dir = ../../../dali-extension
 
 # evas-plugin
+if EVAS_PLUGIN
 include ../../../dali-extension/devel-api/evas-plugin/file.list
 include ../../../dali-extension/internal/evas-plugin/file.list
+endif
 
 lib_LTLIBRARIES =
 
 lib_LTLIBRARIES += libdali2-extension.la
 
 # Todo Evas plugin separation
+if EVAS_PLUGIN
 libdali2_extension_la_SOURCES = \
             $(evas_plugin_devel_src_files) \
             $(evas_plugin_internal_src_files)
+endif
 
 libdali2_extension_la_DEPENDENCIES =
 
@@ -38,21 +42,29 @@ libdali2_extension_la_CXXFLAGS = \
             $(DALI_CFLAGS) \
             $(DALI_EXTENSION_CFLAGS) \
             $(DALI_ADAPTOR_INTEGRATION_CFLAGS) \
-            $(ELEMENTARY_CFLAGS) \
-            $(EVAS_CFLAGS) \
             $(WAYLAND_CFLAGS) \
             -DEFL_BETA_API_SUPPORT \
             -I../../../ \
             -Werror -Wall
 
+if EVAS_PLUGIN
+libdali2_extension_la_CXXFLAGS += \
+            $(ELEMENTARY_CFLAGS) \
+            $(EVAS_CFLAGS)
+endif
+
 libdali2_extension_la_LIBADD = \
             $(DLOG_LIBS) \
             $(DALI_LIBS) \
             $(DALI_ADAPTOR_INTEGRATION_LIBS) \
-            $(ELEMENTARY_LIBS) \
-            $(EVAS_LIBS) \
             $(WAYLAND_LIBS)
 
+if EVAS_PLUGIN
+libdali2_extension_la_LIBADD += \
+            $(ELEMENTARY_LIBS) \
+            $(EVAS_LIBS)
+endif
+
 libdali2_extension_la_LDFLAGS = \
             -rdynamic
 
@@ -60,5 +72,8 @@ libdali2_extension_la_LDFLAGS = \
 dali2_extensiondir = $(devincludepath)/dali-extension
 dali2_extension_HEADERS = ../../../dali-extension/dali-extension.h
 
+if EVAS_PLUGIN
 dali2_extension_evasplugindir = $(devincludepath)/dali-extension/devel-api/evas-plugin
 dali2_extension_evasplugin_HEADERS = $(evas_plugin_devel_header_files)
+endif
+
index 423d19a..e1a4f55 100755 (executable)
@@ -16,15 +16,20 @@ LT_INIT
 DALI_EXTENSION_VERSION=dali_version
 AC_SUBST(DALI_EXTENSION_VERSION)
 
+AM_CONDITIONAL([EVAS_PLUGIN], [test x$evas_plugin = xtrue])
+
 if test "x$enable_debug" = "xyes"; then
   DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
 fi
 
-# For evas-plugin
 PKG_CHECK_MODULES(DALI_ADAPTOR_INTEGRATION, dali2-adaptor-integration)
+PKG_CHECK_MODULES(WAYLAND, [ecore-wl2])
+
+# For evas-plugin
+if test "x$enable_evas_plugin" = "xyes"; then
 PKG_CHECK_MODULES(ELEMENTARY, elementary)
 PKG_CHECK_MODULES(EVAS, evas)
-PKG_CHECK_MODULES(WAYLAND, [ecore-wl2])
+fi
 
 devincludepath=${includedir}
 AC_SUBST(devincludepath)
index 3d634aa..f257b61 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_EXTENSION_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,7 +18,9 @@
  *
  */
 
+#if defined(EVAS_PLUGIN)
 #include <dali-extension/devel-api/evas-plugin/evas-plugin.h>
 #include <dali-extension/devel-api/evas-plugin/scene.h>
+#endif
 
 #endif // DALI_EXTENSION_H
old mode 100755 (executable)
new mode 100644 (file)
index f39c0a7..4c7ae98
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // HEADER
 #include "loader-dummy.h"
 
-#include <dali/integration-api/debug.h>
-#include <dali/public-api/images/image.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/debug.h>
 // INTERNAL INCLUDES
 
 namespace Dali
 {
 namespace Plugin
 {
-
 /**
  * This code is a dummy code. You can implement it here.
  */
 
-bool LoadImageHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadImageHeader(const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height)
 {
   bool success = false;
   /* Loads the header of a image file and fills in the width and height appropriately. */
@@ -40,8 +38,7 @@ bool LoadImageHeader( const Dali::ImageLoader::Input& input, unsigned int& width
   return success;
 }
 
-
-bool LoadBitmapFromImage( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromImage(const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap)
 {
   bool success = false;
   /* Loads the bitmap from an image file.  This function checks the header first */
@@ -49,5 +46,5 @@ bool LoadBitmapFromImage( const Dali::ImageLoader::Input& input, Dali::Devel::Pi
   return success;
 }
 
-}
-}
+} // namespace Plugin
+} // namespace Dali
old mode 100755 (executable)
new mode 100644 (file)
index 34bf24b..70ca83b
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@
  */
 
 // CLASS HEADER
-#include <tizen-image-loader.h>
-#include <dali/integration-api/debug.h>
 #include <dali/integration-api/bitmap.h>
+#include <dali/integration-api/debug.h>
+#include <tizen-image-loader.h>
 #include "loader-dummy.h"
 
 // The plugin factories
@@ -27,9 +27,9 @@ extern "C" DALI_EXPORT_API Dali::ImageLoaderPlugin* CreateImageLoaderPlugin(void
   return new Dali::Plugin::TizenImageLoader;
 }
 
-extern "C" DALI_EXPORT_API void DestroyImageLoaderPlugin( Dali::ImageLoaderPlugin* plugin )
+extern "C" DALI_EXPORT_API void DestroyImageLoaderPlugin(Dali::ImageLoaderPlugin* plugin)
 {
-  if( plugin != NULL )
+  if(plugin != NULL)
   {
     delete plugin;
   }
@@ -41,62 +41,59 @@ namespace Plugin
 {
 namespace
 {
-  /**
+/**
    * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
    */
-  enum FileFormats
-  {
-    // Unknown file format
-    FORMAT_UNKNOWN = -1,
+enum FileFormats
+{
+  // Unknown file format
+  FORMAT_UNKNOWN = -1,
 
-    // formats that use magic bytes
-    FORMAT_DUMMY = 0,
-    FORMAT_TOTAL_COUNT
-  };
+  // formats that use magic bytes
+  FORMAT_DUMMY = 0,
+  FORMAT_TOTAL_COUNT
+};
 
-  /**
+/**
    * A lookup table containing all the bitmap loaders with the appropriate information.
    * Has to be in sync with enum FileFormats
    */
-  const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] =
+const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] =
   {
-    { 0x0,                0x0,                LoadBitmapFromImage,  LoadImageHeader,  Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS },
-  };
-
+    {0x0, 0x0, LoadBitmapFromImage, nullptr, LoadImageHeader, Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS},
+};
 
-  struct FormatExtension
-  {
-    const std::string extension;
-    FileFormats format;
-  };
+struct FormatExtension
+{
+  const std::string extension;
+  FileFormats       format;
+};
 
-  const FormatExtension FORMAT_EXTENSIONS[] =
+const FormatExtension FORMAT_EXTENSIONS[] =
   {
-    { ".dummy",  FORMAT_DUMMY  }
-  };
+    {".dummy", FORMAT_DUMMY}};
 
-  const unsigned int FORMAT_EXTENSIONS_COUNT = sizeof(FORMAT_EXTENSIONS) / sizeof(FormatExtension);
+const unsigned int FORMAT_EXTENSIONS_COUNT = sizeof(FORMAT_EXTENSIONS) / sizeof(FormatExtension);
 
+FileFormats GetFormatHint(const std::string& filename)
+{
+  FileFormats format = FORMAT_UNKNOWN;
 
-  FileFormats GetFormatHint( const std::string& filename )
+  for(unsigned int i = 0; i < FORMAT_EXTENSIONS_COUNT; ++i)
   {
-    FileFormats format = FORMAT_UNKNOWN;
-
-    for ( unsigned int i = 0; i < FORMAT_EXTENSIONS_COUNT; ++i )
+    unsigned int length = FORMAT_EXTENSIONS[i].extension.size();
+    if((filename.size() > length) &&
+       (0 == filename.compare(filename.size() - length, length, FORMAT_EXTENSIONS[i].extension)))
     {
-      unsigned int length = FORMAT_EXTENSIONS[i].extension.size();
-      if ( ( filename.size() > length ) &&
-           ( 0 == filename.compare( filename.size() - length, length, FORMAT_EXTENSIONS[i].extension ) ) )
-      {
-        format = FORMAT_EXTENSIONS[i].format;
-        break;
-      }
+      format = FORMAT_EXTENSIONS[i].format;
+      break;
     }
-    return format;
   }
-
+  return format;
 }
 
+} // namespace
+
 TizenImageLoader::TizenImageLoader()
 {
 }
@@ -105,11 +102,11 @@ TizenImageLoader::~TizenImageLoader()
 {
 }
 
-const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup( const std::string& filename ) const
+const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup(const std::string& filename) const
 {
-  const Dali::ImageLoader::BitmapLoader *lookupPtr = BITMAP_LOADER_LOOKUP_TABLE;
-  FileFormats format =  GetFormatHint( filename );
-  if ( format != FORMAT_UNKNOWN )
+  const Dali::ImageLoader::BitmapLoaderlookupPtr = BITMAP_LOADER_LOOKUP_TABLE;
+  FileFormats                            format    = GetFormatHint(filename);
+  if(format != FORMAT_UNKNOWN)
   {
     lookupPtr = BITMAP_LOADER_LOOKUP_TABLE + format;
     return lookupPtr;
@@ -123,4 +120,3 @@ const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup( con
 } // namespace Plugin
 
 } // namespace Dali
-
index 4430213..4dfb521 100755 (executable)
@@ -43,11 +43,14 @@ BuildRequires:  pkgconfig(dali2-adaptor)
 BuildRequires:  pkgconfig(dali2-toolkit)
 BuildRequires:  pkgconfig(dlog)
 
-# For evas-plugin
 BuildRequires:  pkgconfig(dali2-adaptor-integration)
+BuildRequires:  pkgconfig(ecore-wl2)
+
+# For evas-plugin
+%if 0%{?enable_evas_plugin}
 BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(evas)
-BuildRequires:  pkgconfig(ecore-wl2)
+%endif
 
 %if 0%{?tizen_65_or_greater}
 BuildRequires:  pkgconfig(rive_tizen)
@@ -213,9 +216,6 @@ Header & package configuration of rive-animation-view
 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
 %define dev_include_path %{_includedir}
 
-# Use Image Loader Plugin
-%define use_image_loader 0
-
 ##############################
 # Build
 ##############################
@@ -255,12 +255,17 @@ autoreconf --install
 %if 0%{?enable_web_engine_plugin} == 1
            --enable-web-engine-plugin \
 %endif
+%if 0%{?enable_image_loader}
+           --enable-imageloader-extension \
+%endif
+%if 0%{?enable_color_controller}
+           --enable-color-controller \
+%endif
+%if 0%{?enable_evas_plugin}
+           --enable-evas-plugin \
+%endif
            --enable-ecore-wl2 \
            --enable-keyextension
-%if 0%{?use_image_loader}
-%configure \
-           --enable-imageloader-extension
-%endif
 
 make %{?jobs:-j%jobs}
 
@@ -315,9 +320,11 @@ popd
 exit 0
 %endif
 
+%if 0%{?enable_image_loader}
 %post image-loader-plugin
 /sbin/ldconfig
 exit 0
+%endif
 
 %if 0%{?tizen_55_or_greater}
 %post vector-animation-renderer-plugin
@@ -331,9 +338,11 @@ exit 0
 exit 0
 %endif
 
+%if 0%{?enable_color_controller}
 %post color-controller-plugin
 /sbin/ldconfig
 exit 0
+%endif
 
 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
 %post web-engine-lwe-plugin
@@ -372,9 +381,11 @@ exit 0
 exit 0
 %endif
 
+%if 0%{?enable_image_loader}
 %postun image-loader-plugin
 /sbin/ldconfig
 exit 0
+%endif
 
 %if 0%{?tizen_55_or_greater}
 %postun vector-animation-renderer-plugin
@@ -388,9 +399,11 @@ exit 0
 exit 0
 %endif
 
+%if 0%{?enable_color_controller}
 %postun color-controller-plugin
 /sbin/ldconfig
 exit 0
+%endif
 
 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
 %postun web-engine-lwe-plugin
@@ -442,7 +455,7 @@ exit 0
 %license LICENSE
 %endif
 
-%if 0%{?use_image_loader}
+%if 0%{?enable_image_loader}
 %files image-loader-plugin
 %manifest dali-extension.manifest
 %defattr(-,root,root,-)
@@ -471,11 +484,13 @@ exit 0
 %{_libdir}/pkgconfig/dali2-extension-rive-animation-view.pc
 %endif
 
+%if 0%{?enable_color_controller}
 %files color-controller-plugin
 %manifest dali-extension.manifest
 %defattr(-,root,root,-)
 %{_libdir}/libdali2-color-controller-plugin.so*
 %license LICENSE
+%endif
 
 %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1
 %files web-engine-lwe-plugin