halapi: common: Divide hal-common.h into two header files 62/250462/4
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 28 Dec 2020 04:50:34 +0000 (13:50 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 28 Dec 2020 08:58:17 +0000 (17:58 +0900)
Divide hal-common.h into two header files as following:
- hal-common.h is used for HAL API packages (/platform/hal/api/)
- hal-common-interface.h is used for HAL backend packages (/platform/hal/device/)

Change-Id: Ida3192ed4dbb29d9b718b2b90f3a61f8ed380e2e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
include/hal-common-interface.h [new file with mode: 0644]
include/hal-common.h

index 935bf78..359496c 100644 (file)
@@ -34,12 +34,15 @@ ADD_DEFINITIONS("-DLOG_TAG=\"HALAPI_COMMON\"")
 SET(SRCS
        src/hal-api-common.c)
 
-ADD_LIBRARY(           ${PROJECT_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${pkgs_LDFLAGS} -Wl,-z,nodelete,--no-undefined)
-SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
-
-CONFIGURE_FILE(                ${PROJECT_NAME}.pc ${PROJECT_NAME}.pc @ONLY)
-INSTALL(TARGETS                ${PROJECT_NAME} DESTINATION ${LIBDIR}/hal)
-INSTALL(FILES          ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-common.h DESTINATION ${INCLUDEDIR}/hal)
-INSTALL(FILES          ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
+ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${pkgs_LDFLAGS} -Wl,-z,nodelete,--no-undefined)
+SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
+SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
+
+CONFIGURE_FILE( ${PROJECT_NAME}.pc ${PROJECT_NAME}.pc @ONLY)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}/hal)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
+       DESTINATION ${INCLUDEDIR}/hal
+       FILES_MATCHING PATTERN "*.h")
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc
+       DESTINATION ${LIBDIR}/pkgconfig)
diff --git a/include/hal-common-interface.h b/include/hal-common-interface.h
new file mode 100644 (file)
index 0000000..40ef158
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * HAL (Hardware Abstract Layer) Common Interface
+ *
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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_COMMON_INTERFACE__
+#define __HAL_COMMON_INTERFACE__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum hal_abi_version {
+       HAL_ABI_VERSION_UNKNOWN = 0,
+       HAL_ABI_VERSION_TIZEN_6_5,
+       HAL_ABI_VERSION_END,
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_COMMON_INTERFACE__ */
index 165993a..0be04a1 100644 (file)
 #ifndef __HAL_COMMON__
 #define __HAL_COMMON__
 
+#include "hal-common-interface.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-enum hal_abi_version {
-       HAL_ABI_VERSION_UNKNOWN = 0,
-       HAL_ABI_VERSION_TIZEN_6_5,
-       HAL_ABI_VERSION_END,
-};
-
 enum hal_license {
        HAL_LICENSE_UNKNOWN = 0,
        HAL_LICENSE_APACHE_2_0,