From 15a42f76140494dc0f5dfb9b8297a5848da0de92 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Tue, 11 Jul 2023 10:36:43 +0900 Subject: [PATCH] power-internal: Exclude only device_power_get_wakeup_reason() on a specific profile The previous patch(733acf) excludes the whole power-internal.c/.h when they are built on a specific build envrionment. In such case, however, there were other pakages dependent on the power-internal.c/.h, making build error. Thus, instead of excluding the whole power-internal.c/.h, exclude only the function device_power_get_wakeup_reason() from building. Change-Id: Ib7474394246cf2d4e48b9ca312546f1970348ce9 Signed-off-by: Youngjae Cho --- CMakeLists.txt | 11 +++-------- include/power-internal.h | 2 ++ src/power-internal.c | 2 ++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3867611..5c6f502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,13 +38,13 @@ ENDIF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DFEATURE_DEVICE_DLOG") ADD_DEFINITIONS("-DLIBPATH=\"${LIB_INSTALL_DIR}\"") +IF(${EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE}) + ADD_DEFINITIONS("-DEXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE") +ENDIF() SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}") aux_source_directory(src SOURCES) -IF(${EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE}) - LIST(REMOVE_ITEM SOURCES "src/power-internal.c") -ENDIF() ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS}) @@ -60,15 +60,10 @@ INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/device.h ${INC_DIR}/device-error.h DESTINATION include/system) -IF(${EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE}) - SET(EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE_PATTERN PATTERN "power-internal.h" EXCLUDE) -ENDIF() - INSTALL( DIRECTORY ${INC_DIR}/ DESTINATION include/device FILES_MATCHING PATTERN "device.h" EXCLUDE - ${EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE_PATTERN} PATTERN "${INC_DIR}/*.h" ) diff --git a/include/power-internal.h b/include/power-internal.h index 0037fba..da79697 100644 --- a/include/power-internal.h +++ b/include/power-internal.h @@ -258,6 +258,7 @@ int device_power_change_state(device_power_state_e state, int timeout_sec, devic */ int device_power_check_reboot_allowed(void); +#ifndef EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE /** * @brief Get wakeup reason. * @since_tizen 7.0 @@ -269,6 +270,7 @@ int device_power_check_reboot_allowed(void); * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter */ int device_power_get_wakeup_reason(device_power_transition_reason_e *reason); +#endif /** * @brief Called when the registered power lock is changed. diff --git a/src/power-internal.c b/src/power-internal.c index a733b50..60aca42 100644 --- a/src/power-internal.c +++ b/src/power-internal.c @@ -600,6 +600,7 @@ int device_power_check_reboot_allowed(void) return (retval != 0 || cloned != 0); } +#ifndef EXCLUDE_INTERNAL_CAPI_SYSTEM_DEVICE int device_power_get_wakeup_reason(device_power_transition_reason_e *reason) { int ret, reply; @@ -622,6 +623,7 @@ int device_power_get_wakeup_reason(device_power_transition_reason_e *reason) return DEVICE_ERROR_NONE; } +#endif static void power_lock_state_change_cb(GDBusConnection *connection, const gchar *sender_name, -- 2.7.4