aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl
diff options
context:
space:
mode:
Diffstat (limited to 'ctrl/libhicnctrl')
-rw-r--r--ctrl/libhicnctrl/CMakeLists.txt21
-rw-r--r--ctrl/libhicnctrl/cmake/Modules/Packaging.cmake55
-rw-r--r--ctrl/libhicnctrl/src/CMakeLists.txt4
-rw-r--r--ctrl/libhicnctrl/src/hicn_plugin_api.c1
4 files changed, 56 insertions, 25 deletions
diff --git a/ctrl/libhicnctrl/CMakeLists.txt b/ctrl/libhicnctrl/CMakeLists.txt
index 59620088e..2a131f155 100644
--- a/ctrl/libhicnctrl/CMakeLists.txt
+++ b/ctrl/libhicnctrl/CMakeLists.txt
@@ -34,25 +34,32 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_MACOSX_RPATH ON)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
-
- if (BUILD_CTRL_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+ set(HICNCTRL hicnctrl)
+ set(LIBHICNCTRL hicnctrl)
+ if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+ set(LIBHICNCTRL ${LIBHICNCTRL}-plugin)
find_package_wrapper(HicnPlugin REQUIRED)
- else ()
- find_package_wrapper(Libhicn REQUIRED)
+ list(APPEND HICN_LIBRARIES ${HICNPLUGIN_LIBRARIES})
+ set(LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs")
endif()
- set(HICNCTRL hicnctrl)
- set(LIBHICNCTRL hicnctrl)
+ find_package_wrapper(Libhicn REQUIRED)
+ list(APPEND HICN_LIBRARIES ${LIBHICN_SHARED})
+
set(LIBHICNCTRL_SHARED ${LIBHICNCTRL}.shared)
set(LIBHICNCTRL_STATIC ${LIBHICNCTRL}.static)
+ set(HICN_INCLUDE_DIRS
+ ${HICN_INCLUDE_DIRS}
+ ${HICNPLUGIN_INCLUDE_DIRS})
+
else()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(HICN_LIBRARIES ${LIBHICN_STATIC} log)
list(APPEND DEPENDENCIES
${LIBHICN_STATIC}
)
- elseif (BUILD_CTRL_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+ elseif (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(HICN_INCLUDE_DIRS
${HICN_INCLUDE_DIRS}
${HICNPLUGIN_INCLUDE_DIRS})
diff --git a/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake b/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake
index cbee25d35..92e9d4adb 100644
--- a/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake
+++ b/ctrl/libhicnctrl/cmake/Modules/Packaging.cmake
@@ -25,22 +25,45 @@ set(${LIBHICNCTRL_COMPONENT}-dev_DESCRIPTION
CACHE STRING "Description for deb/rpm package."
)
-set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES
- ""
- CACHE STRING "Dependencies for deb/rpm package."
-)
+if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+ set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES
+ ""
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
-set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES
- "${LIBHICNCTRL_COMPONENT} (>= stable_version)"
- CACHE STRING "Dependencies for deb/rpm package."
-)
+ set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES
+ "${LIBHICNCTRL_COMPONENT} (>= stable_version), hicn-plugin-dev (>= stable_version-release), hicn-plugin-dev (<< next_version-release)"
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
-set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES
- ""
- CACHE STRING "Dependencies for deb/rpm package."
-)
+ set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES
+ ""
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
+
+ set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES
+ "${LIBHICNCTRL_COMPONENT} >= stable_version, hicn-plugin-dev >= stable_version-release, hicn-plugin-dev < next_version-release"
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
-set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES
- "${LIBHICNCTRL_COMPONENT} >= stable_version"
- CACHE STRING "Dependencies for deb/rpm package."
-) \ No newline at end of file
+else ()
+ set(${LIBHICNCTRL_COMPONENT}_DEB_DEPENDENCIES
+ ""
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
+
+ set(${LIBHICNCTRL_COMPONENT}-dev_DEB_DEPENDENCIES
+ "${LIBHICNCTRL_COMPONENT} (>= stable_version)"
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
+
+ set(${LIBHICNCTRL_COMPONENT}_RPM_DEPENDENCIES
+ ""
+ CACHE STRING "Dependencies for deb/rpm package."
+ )
+
+ set(${LIBHICNCTRL_COMPONENT}-dev_RPM_DEPENDENCIES
+ "${LIBHICNCTRL_COMPONENT} >= stable_version"
+ CACHE STRING "Dependencies for deb/rpm package."
+)
+endif() \ No newline at end of file
diff --git a/ctrl/libhicnctrl/src/CMakeLists.txt b/ctrl/libhicnctrl/src/CMakeLists.txt
index 42fe3d543..6f4066238 100644
--- a/ctrl/libhicnctrl/src/CMakeLists.txt
+++ b/ctrl/libhicnctrl/src/CMakeLists.txt
@@ -30,7 +30,7 @@ set(SOURCE_FILES
route.c
)
-if(BUILD_CTRL_HICNPLUGIN)
+if(BUILD_HICNPLUGIN)
set(SOURCE_FILES
${SOURCE_FILES}
hicn_plugin_api.c
@@ -53,7 +53,7 @@ set(INCLUDE_DIRS
${HICN_INCLUDE_DIRS}
)
-# Android requires static libraries
+# Android requires static libraries
if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(LIBRARIES ${LIBRARIES} ${LIBHICN_STATIC})
set(LINK_TYPE STATIC)
diff --git a/ctrl/libhicnctrl/src/hicn_plugin_api.c b/ctrl/libhicnctrl/src/hicn_plugin_api.c
index d0f1eae10..233abb0f8 100644
--- a/ctrl/libhicnctrl/src/hicn_plugin_api.c
+++ b/ctrl/libhicnctrl/src/hicn_plugin_api.c
@@ -360,6 +360,7 @@ int hc_sock_connect(hc_sock_t *s) {
vapi_ctx_free(vapi_skc.g_vapi_ctx_instance);
goto ERR_CONNECT;
}
+ s->g_vapi_ctx_instance = vapi_skc.g_vapi_ctx_instance;
printf("[hc_sock_connect] *connected %s ok", APP_NAME);
} else if (s->async == vapi_skc.async){
s->g_vapi_ctx_instance = vapi_skc.g_vapi_ctx_instance;