Remove libwebsocket dependency except wearable profile 89/82989/5
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 8 Aug 2016 12:05:38 +0000 (21:05 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 9 Aug 2016 05:42:44 +0000 (14:42 +0900)
The usage of PSS is decreased by 462KB in mobile profile.

Change-Id: I1b36eb8cf3a11e53533c5106db7702707148ee09
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt
packaging/libscl-core.spec
src/sclcoreui-efl.cpp
src/sclcoreui-efl.h

index 5d92453..3bd64d6 100644 (file)
@@ -8,8 +8,6 @@ SET(SRCS
     src/sclconnection.cpp
     src/sclconnection-isf.cpp
     src/sclcore.cpp
-    src/legacy_support/websocket.cpp
-    src/legacy_support/web_helper_agent.cpp
 )
 
 SET(PACKAGE ${PROJECT_NAME})
@@ -35,17 +33,26 @@ SET(PKGS_CHECK_MODULES
         isf
         vconf
         libscl-common
-        libwebsockets
         capi-appfw-application
         )
 
 IF (with_wayland)
         ADD_DEFINITIONS("-DWAYLAND")
-        pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-wayland wayland-client input-method-client)
+        SET(PKGS_CHECK_MODULES ${PKGS_CHECK_MODULES} ecore-wayland wayland-client input-method-client)
 ELSE (with_wayland)
-        pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x x11)
+        SET(PKGS_CHECK_MODULES ${PKGS_CHECK_MODULES} ecore-x x11)
 ENDIF(with_wayland)
 
+IF (with_websocket)
+        ADD_DEFINITIONS("-DWEBSOCKET")
+        SET(SRCS ${SRCS}
+            src/legacy_support/websocket.cpp
+            src/legacy_support/web_helper_agent.cpp)
+        SET(PKGS_CHECK_MODULES ${PKGS_CHECK_MODULES} libwebsockets)
+ENDIF(with_websocket)
+
+pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES})
+
 FOREACH(flag ${pkgs_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index abc6db1..3d81824 100644 (file)
@@ -1,6 +1,12 @@
 %bcond_with x
 %bcond_with wayland
 
+%if "%{?profile}" == "wearable"
+%define WITH_WEBSOCKET TRUE
+%else
+%define WITH_WEBSOCKET FALSE
+%endif
+
 Name:       libscl-core
 Summary:    A library for developing software keyboards
 Version:    0.4.25
@@ -23,7 +29,9 @@ BuildRequires:  pkgconfig(x11)
 %endif
 BuildRequires:  pkgconfig(libscl-common)
 BuildRequires:  pkgconfig(capi-appfw-application)
+%if "%{WITH_WEBSOCKET}" == "TRUE"
 BuildRequires:  pkgconfig(libwebsockets)
+%endif
 
 
 %description
@@ -50,9 +58,9 @@ rm -rf CMakeFiles
 rm -rf CMakeCache.txt
 
 %if %{with wayland}
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_wayland=TRUE -Dwith_websocket=%{WITH_WEBSOCKET}
 %else
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} -Dwith_websocket=%{WITH_WEBSOCKET}
 %endif
 make %{?_smp_mflags}
 
index 1f2cf5d..710f2ee 100644 (file)
@@ -84,7 +84,9 @@ sclboolean CSCLCoreUIEFL::init()
         m_option_window_info[loop].window = SCLWINDOW_INVALID;
     }
 
+#ifdef WEBSOCKET
     m_websocket.init();
+#endif
 
     return TRUE;
 }
@@ -93,7 +95,9 @@ void CSCLCoreUIEFL::fini()
 {
     m_initialized = FALSE;
 
+#ifdef WEBSOCKET
     m_websocket.exit();
+#endif
 }
 
 sclwindow CSCLCoreUIEFL::get_main_window()
index 1a3435d..5a383f7 100644 (file)
@@ -22,7 +22,9 @@
 
 #include <Ecore.h>
 
+#ifdef WEBSOCKET
 #include "legacy_support/websocket.h"
+#endif
 
 //SCL_BEGIN_DECLS
 
@@ -61,8 +63,10 @@ private:
 
     OptionWindowInfo m_option_window_info[OPTION_WINDOW_TYPE_MAX];
 
+#ifdef WEBSOCKET
     /* This websocket agent is for supporting Tizen 2.X legacy web IMEs that uses websocket */
     CWebHelperAgentWebSocket m_websocket;
+#endif
 };
 
 }