From: cheoleun moon Date: Fri, 11 Oct 2024 11:40:29 +0000 (+0900) Subject: Remove bt dependency in movable project X-Git-Tag: accepted/tizen/unified/20241015.153151~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bff3ec185aaf0ee74da18c72ca600fb2a9026ac1;p=platform%2Fcore%2Fapi%2Fvine.git Remove bt dependency in movable project Change-Id: I9f25f3b719894c4aac034ce1db3e908f04f5ab82 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f7510aa..3ed9dfa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ OPTION(WITH_VINE_TEST "With vine command-line test tools" OFF) OPTION(ENABLE_INSTRUMENTATION_MODE "Enable instrumentation mode" OFF) OPTION(ENABLE_DATAPATH_PLUGIN_DEBUG "Enable debug mode for data path plugin" OFF) +OPTION(BT_SUPPORT "Support Bluetooth" ON) OPTION(NAN_SUPPORT "Support NAN" OFF) INCLUDE(FindPkgConfig) @@ -90,11 +91,13 @@ IF(TIZEN_OS) ADD_DEFINITIONS("-DTIZEN_OS -DUSE_DLOG") ENDIF(TIZEN_OS) -SET(BT_SUPPORT OFF) -IF(TIZEN_OS AND USE_EVENT_LOOP_EXTERNAL_GLIB) - ADD_DEFINITIONS("-DBT_SUPPORT") - SET(BT_SUPPORT ON) -ENDIF(TIZEN_OS AND USE_EVENT_LOOP_EXTERNAL_GLIB) +IF(BT_SUPPORT) + IF(TIZEN_OS AND USE_EVENT_LOOP_EXTERNAL_GLIB) + ADD_DEFINITIONS("-DBT_SUPPORT") + ELSE(TIZEN_OS AND USE_EVENT_LOOP_EXTERNAL_GLIB) + SET(BT_SUPPORT OFF) + ENDIF(TIZEN_OS AND USE_EVENT_LOOP_EXTERNAL_GLIB) +ENDIF(BT_SUPPORT) IF(NAN_SUPPORT) IF(NOT TIZEN_OS OR NOT USE_EVENT_LOOP_EXTERNAL_GLIB) diff --git a/packaging/capi-network-vine.spec b/packaging/capi-network-vine.spec index d4a07db..9e66ee2 100755 --- a/packaging/capi-network-vine.spec +++ b/packaging/capi-network-vine.spec @@ -3,7 +3,7 @@ %bcond_without use_glib_event_loop Name: capi-network-vine Summary: An service discovery framework -Version: 1.3.4 +Version: 1.3.5 Release: 0 Group: Network & Connectivity/API License: Apache-2.0 @@ -110,6 +110,9 @@ export FFLAGS+=" -fprofile-arcs -ftest-coverage" %else -DUSE_EVENT_LOOP_EXTERNAL_GLIB=OFF \ %endif +%if "%{mv_prj}" == "1" + -DBT_SUPPORT=OFF \ +%endif %if %{with lws_static} -DUSE_LIBWEBSOCKETS_STATIC=ON \ %else diff --git a/src/vine-disc.cpp b/src/vine-disc.cpp index 7b0679d..65b5c81 100755 --- a/src/vine-disc.cpp +++ b/src/vine-disc.cpp @@ -33,9 +33,13 @@ static struct { [VINE_DISCOVERY_METHOD_DNS_SD] = {"DNS-SD", DNS_SD_PLUGIN_PATH}, #ifdef BT_SUPPORT [VINE_DISCOVERY_METHOD_BLE] = {"BLE", BLE_PLUGIN_PATH}, +#else + [VINE_DISCOVERY_METHOD_BLE] = {"BLE", NULL}, #endif #ifdef NAN_SUPPORT [VINE_DISCOVERY_METHOD_NAN] = {"NAN", NAN_PLUGIN_PATH}, +#else + [VINE_DISCOVERY_METHOD_NAN] = {"NAN", NULL}, #endif {NULL, NULL}, }; @@ -329,7 +333,12 @@ void __fd_removed_cb(int fd, void *user_data) static int __load_disc_plugins() { - for (int i = 0; __vine_disc_plugins_info[i].path; ++i) { + for (int i = 0; __vine_disc_plugins_info[i].name; ++i) { + if (__vine_disc_plugins_info[i].path == NULL) { + VINE_LOGI("%s is not supported.", __vine_disc_plugins_info[i].name); + continue; + } + void *handle = dlopen(__vine_disc_plugins_info[i].path, RTLD_LAZY | RTLD_NODELETE); if (handle) { __vine_disc_plugins[i].init =