Skip to content

Commit

Permalink
fix:Desktop build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nlrcomcast committed Dec 3, 2023
1 parent b5e3ac7 commit f10201b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: CMake
working-directory: build
run: |
cmake .. -DWEBCONFIG_BIN_SUPPORT:BOOL=true -DWAN_FAILOVER_SUPPORTED:BOOL=true -DINTEGRATION_TESTING:BOOL=false -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND} -DENABLE_SESHAT:BOOL=true -DFEATURE_DNS_QUERY:BOOL=true
cmake .. -DWEBCONFIG_BIN_SUPPORT:BOOL=true -DWAN_FAILOVER_SUPPORTED:BOOL=true -DBUILD_GIT:BOOL=true -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND}
- name: Unit tests run
working-directory: build
Expand All @@ -59,6 +59,10 @@ jobs:
export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install && \
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${LD_LIBRARY_PATH}
export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include
mkdir _install
mkdir _install/lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all test
- name: Stop rtrouted
Expand Down
41 changes: 21 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ if (MULTIPART_UTILITY)
add_definitions(-DMULTIPART_UTILITY)
endif (MULTIPART_UTILITY)

if (WEBCONFIG_BIN_SUPPORT)

# rbus external dependency
#-------------------------------------------------------------------------------
ExternalProject_Add(rbus
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/rbus
GIT_REPOSITORY https://github.com/rdkcentral/rbus.git
GIT_TAG main
CMAKE_ARGS += -DBUILD_FOR_DESKTOP=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF
)

add_library(librbuscore STATIC SHARED IMPORTED)
add_dependencies(librbuscore rbuscore)

add_library(librtMessage STATIC SHARED IMPORTED)
add_dependencies(librtMessage rtMessage)

add_library(librbus STATIC SHARED IMPORTED)
add_dependencies(librbus rbus)
endif (WEBCONFIG_BIN_SUPPORT)

# msgpack-c external dependency
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -223,6 +203,27 @@ add_library(libcmocka STATIC SHARED IMPORTED)
add_dependencies(libcmocka cmocka)

endif (BUILD_TESTING)

if (( NOT BUILD_GIT) AND WEBCONFIG_BIN_SUPPORT)

# rbus external dependency
#-------------------------------------------------------------------------------
ExternalProject_Add(rbus
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_prefix/rbus
GIT_REPOSITORY https://github.com/rdkcentral/rbus.git
GIT_TAG main
CMAKE_ARGS += -DBUILD_FOR_DESKTOP=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DBUILD_TESTING=OFF
)

add_library(librbuscore STATIC SHARED IMPORTED)
add_dependencies(librbuscore rbuscore)

add_library(librtMessage STATIC SHARED IMPORTED)
add_dependencies(librtMessage rtMessage)

add_library(librbus STATIC SHARED IMPORTED)
add_dependencies(librbus rbus)
endif ()
endif ()

link_directories ( ${LIBRARY_DIR} ${COMMON_LIBRARY_DIR} ${LIBRARY_DIR64} )
Expand Down
2 changes: 1 addition & 1 deletion src/webcfg_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "webcfg_log.h"
#if defined(WEBCONFIG_BIN_SUPPORT)
#include "webcfg_rbus.h"
#include <rbus.h>
#include <rbus/rbus.h>
#endif
/*----------------------------------------------------------------------------*/
/* Macros */
Expand Down
2 changes: 1 addition & 1 deletion src/webcfg_generic_pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "webcfg_log.h"
#if defined(WEBCONFIG_BIN_SUPPORT)
#include "webcfg_rbus.h"
#include <rbus.h>
#include <rbus/rbus.h>
#endif
/*----------------------------------------------------------------------------*/
/* Macros */
Expand Down
4 changes: 2 additions & 2 deletions tests/test_multipart_unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,6 @@ void test_processMsgpackSubdoc_msgpack_failure()

void test_processMsgpackSubdoc_setValues_rbus()
{
webconfigRbusInit("consumerComponent");
regWebConfigDataModel();
int res = rbus_open(&handle, "providerComponent");
if(res != RBUS_ERROR_SUCCESS)
{
Expand All @@ -1156,6 +1154,8 @@ void test_processMsgpackSubdoc_setValues_rbus()
rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement);
CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS);

webconfigRbusInit("consumerComponent");
regWebConfigDataModel();
SubDocSupportMap_t *supportdocs = (SubDocSupportMap_t *)malloc(sizeof(SubDocSupportMap_t));
if(supportdocs)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rbus_fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,6 @@ void test_blobSet_rbus()
WDMP_STATUS retStatus = WDMP_FAILURE;
int ccspStatus = 0;

webconfigRbusInit("consumerComponent");
int res = rbus_open(&handle, "providerComponent");
if(res != RBUS_ERROR_SUCCESS)
{
Expand All @@ -1785,6 +1784,7 @@ void test_blobSet_rbus()
rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement);
CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS);

webconfigRbusInit("consumerComponent");
blobSet_rbus(WEBCFG_BLOB_PARAM, buff, sendMsgSize, &retStatus, &ccspStatus);
CU_ASSERT_EQUAL(CCSP_Msg_Bus_OK, ccspStatus);
CU_ASSERT_EQUAL(WDMP_SUCCESS, retStatus);
Expand Down

0 comments on commit f10201b

Please sign in to comment.