summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2021-02-15 11:30:51 +0900
committerlokilee73 <changjoo.lee@samsung.com>2021-02-15 11:30:55 +0900
commit07bd14990fbbdc4b08545b19d2fdb9dcdd3ea498 (patch)
treeb87d633dd19683a3d6c25d764c2491552458c76f
parenta61095ce67876f174844a1c2d07a330d93ec519b (diff)
downloaddevice-emulator-07bd14990fbbdc4b08545b19d2fdb9dcdd3ea498.tar.gz
device-emulator-07bd14990fbbdc4b08545b19d2fdb9dcdd3ea498.tar.bz2
device-emulator-07bd14990fbbdc4b08545b19d2fdb9dcdd3ea498.zip
Move common macro to device-common
Change-Id: Ia506fbf4ddc5020df1c63c229fcd90afe702a36d Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rw-r--r--CMakeLists.txt2
-rw-r--r--hw/battery/CMakeLists.txt4
-rw-r--r--hw/battery/battery.c3
-rw-r--r--hw/common/common.h37
-rw-r--r--hw/dbus.c3
-rw-r--r--hw/display/CMakeLists.txt4
-rw-r--r--hw/display/display.c2
-rw-r--r--hw/external_connection/CMakeLists.txt4
-rw-r--r--hw/external_connection/external_connection.c3
-rw-r--r--hw/haptic/CMakeLists.txt4
-rw-r--r--hw/haptic/emulator.c3
-rw-r--r--hw/usb_gadget/CMakeLists.txt4
-rw-r--r--hw/usb_gadget/usb_gadget.c3
-rw-r--r--packaging/device-manager-plugin-emul.spec1
14 files changed, 16 insertions, 61 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95791b2..9552c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ IF(ENABLE_DLOG STREQUAL on)
ENDIF()
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog)
+pkg_check_modules(pkgs REQUIRED hal-backend-device-common)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/hw/battery/CMakeLists.txt b/hw/battery/CMakeLists.txt
index 6298cb6..cbea257 100644
--- a/hw/battery/CMakeLists.txt
+++ b/hw/battery/CMakeLists.txt
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-battery C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INCLUDE_DIRECTORIES(../common)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-battery_pkgs REQUIRED dlog glib-2.0 gio-2.0)
+pkg_check_modules(hal-backend-device-battery_pkgs REQUIRED hal-backend-device-common glib-2.0 gio-2.0)
FOREACH(flag ${hal-backend-device-battery_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/hw/battery/battery.c b/hw/battery/battery.c
index 2b323a9..0fd3b4c 100644
--- a/hw/battery/battery.c
+++ b/hw/battery/battery.c
@@ -29,7 +29,8 @@
#include <libsyscommon/file.h>
#include "../dbus.h"
-#include "common.h"
+
+#include </hal/include/device/hal-backend-common.h>
#define BATTERY_BUS "org.tizen.system.deviced"
#define BATTERY_OBJECT "/Org/Tizen/System/DeviceD/SysNoti"
diff --git a/hw/common/common.h b/hw/common/common.h
deleted file mode 100644
index 413ed8a..0000000
--- a/hw/common/common.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __HAL_BACKEND_COMMON_H__
-#define __HAL_BACKEND_COMMON_H__
-
-#ifdef FEATURE_DLOG
- #define LOG_TAG "HAL_BACKEND_DEVICE"
- #include <dlog.h>
- #define _D(fmt, args...) SLOGD(fmt, ##args)
- #define _I(fmt, args...) SLOGI(fmt, ##args)
- #define _W(fmt, args...) SLOGW(fmt, ##args)
- #define _E(fmt, args...) SLOGE(fmt, ##args)
-#else
- #define _D(x, ...)
- #define _I(x, ...)
- #define _W(x, ...)
- #define _E(x, ...)
-#endif
-
-
-#define EXPORT __attribute__ ((visibility("default")))
-
-#endif /* __HAL_BACKEND_COMMON_H__ */
diff --git a/hw/dbus.c b/hw/dbus.c
index 0037593..a7eeaeb 100644
--- a/hw/dbus.c
+++ b/hw/dbus.c
@@ -17,7 +17,8 @@
*/
#include "dbus.h"
-#include "common.h"
+
+#include </hal/include/device/hal-backend-common.h>
int register_dbus_signal(const char *object,
const char *iface, const char *signal,
diff --git a/hw/display/CMakeLists.txt b/hw/display/CMakeLists.txt
index 037e489..d9411fc 100644
--- a/hw/display/CMakeLists.txt
+++ b/hw/display/CMakeLists.txt
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-display C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INCLUDE_DIRECTORIES(../common)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-display_pkgs REQUIRED dlog)
+pkg_check_modules(hal-backend-device-display_pkgs REQUIRED hal-backend-device-common)
FOREACH(flag ${display_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/hw/display/display.c b/hw/display/display.c
index ee59d19..d7f8740 100644
--- a/hw/display/display.c
+++ b/hw/display/display.c
@@ -27,7 +27,7 @@
#include <hal/hal-common-interface.h>
#include <libsyscommon/file.h>
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
#ifndef BACKLIGHT_PATH
#define BACKLIGHT_PATH "/sys/class/backlight/emulator"
diff --git a/hw/external_connection/CMakeLists.txt b/hw/external_connection/CMakeLists.txt
index 58c4c65..ca1da2f 100644
--- a/hw/external_connection/CMakeLists.txt
+++ b/hw/external_connection/CMakeLists.txt
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-external-connection C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INCLUDE_DIRECTORIES(../common)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-external-connection_pkgs REQUIRED dlog glib-2.0 gio-2.0)
+pkg_check_modules(hal-backend-device-external-connection_pkgs REQUIRED hal-backend-device-common glib-2.0 gio-2.0)
FOREACH(flag ${hal-backend-device-external-connection_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/hw/external_connection/external_connection.c b/hw/external_connection/external_connection.c
index 1505477..7fe0127 100644
--- a/hw/external_connection/external_connection.c
+++ b/hw/external_connection/external_connection.c
@@ -30,7 +30,8 @@
#include <libsyscommon/file.h>
#include "../dbus.h"
-#include "common.h"
+
+#include </hal/include/device/hal-backend-common.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
diff --git a/hw/haptic/CMakeLists.txt b/hw/haptic/CMakeLists.txt
index f474599..0c53a66 100644
--- a/hw/haptic/CMakeLists.txt
+++ b/hw/haptic/CMakeLists.txt
@@ -3,11 +3,9 @@ PROJECT(hal-backend-device-haptic C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INCLUDE_DIRECTORIES(../common)
-
INCLUDE(FindPkgConfig)
pkg_check_modules(haptic_pkgs REQUIRED
- dlog
+ hal-backend-device-common
glib-2.0
libsyscommon
capi-system-info)
diff --git a/hw/haptic/emulator.c b/hw/haptic/emulator.c
index 022ab05..1a84702 100644
--- a/hw/haptic/emulator.c
+++ b/hw/haptic/emulator.c
@@ -21,7 +21,8 @@
#include <system_info.h>
#include <libsyscommon/list.h>
#include <hal/device/hal-haptic-interface.h>
-#include "common.h"
+
+#include </hal/include/device/hal-backend-common.h>
static GList *handle_list;
static int unique_number = 0;
diff --git a/hw/usb_gadget/CMakeLists.txt b/hw/usb_gadget/CMakeLists.txt
index 35e615e..7146f92 100644
--- a/hw/usb_gadget/CMakeLists.txt
+++ b/hw/usb_gadget/CMakeLists.txt
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-usb-gadget C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INCLUDE_DIRECTORIES(../common)
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-usb-gadget_pkgs REQUIRED dlog hal-backend-device-common)
+pkg_check_modules(hal-backend-device-usb-gadget_pkgs REQUIRED hal-backend-device-common)
FOREACH(flag ${hal-backend-device-usb-gadget_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/hw/usb_gadget/usb_gadget.c b/hw/usb_gadget/usb_gadget.c
index 30fdb72..c3f825a 100644
--- a/hw/usb_gadget/usb_gadget.c
+++ b/hw/usb_gadget/usb_gadget.c
@@ -21,8 +21,7 @@
#include <hal/device/hal-usb_gadget-interface.h>
#include </hal/include/device/hal-backend-common-usb_gadget.h>
-
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
static int dummy_enable(void)
{
diff --git a/packaging/device-manager-plugin-emul.spec b/packaging/device-manager-plugin-emul.spec
index 0613899..319a5d2 100644
--- a/packaging/device-manager-plugin-emul.spec
+++ b/packaging/device-manager-plugin-emul.spec
@@ -8,7 +8,6 @@ Source0: %{name}-%{version}.tar.gz
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: cmake
-BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(hal-api-common)