power-internal: Exclude only device_power_get_wakeup_reason() on a specific profile 61/295561/2 accepted/tizen/unified/20230713.014421
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 11 Jul 2023 01:36:43 +0000 (10:36 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 11 Jul 2023 04:14:34 +0000 (13:14 +0900)
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 <y0.cho@samsung.com>
CMakeLists.txt
include/power-internal.h
src/power-internal.c

index 3867611..5c6f502 100644 (file)
@@ -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"
         )
 
index 0037fba..da79697 100644 (file)
@@ -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.
index a733b50..60aca42 100644 (file)
@@ -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,