From: lokilee73 Date: Mon, 15 Feb 2021 02:30:51 +0000 (+0900) Subject: Move common macro to device-common X-Git-Tag: submit/tizen/20210607.045509~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07bd14990fbbdc4b08545b19d2fdb9dcdd3ea498;p=platform%2Fhal%2Fbackend%2Femulator%2Fdevice-emulator.git Move common macro to device-common Change-Id: Ia506fbf4ddc5020df1c63c229fcd90afe702a36d Signed-off-by: lokilee73 --- 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 #include "../dbus.h" -#include "common.h" + +#include #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 - #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 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 #include -#include "common.h" +#include #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 #include "../dbus.h" -#include "common.h" + +#include #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 #include #include -#include "common.h" + +#include 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 #include - -#include "common.h" +#include 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)