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 036db7a
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 28 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ 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
run: |
ls -al ${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib
ls -al ${RBUS_INSTALL_DIR}/usr/lib
ps aux
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 LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${RBUS_INSTALL_DIR}/usr/lib:${LD_LIBRARY_PATH}
export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all test
- name: Stop rtrouted
Expand Down
57 changes: 40 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,26 @@ if (MULTIPART_UTILITY)
add_definitions(-DMULTIPART_UTILITY)
endif (MULTIPART_UTILITY)

if (WEBCONFIG_BIN_SUPPORT)
# 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
)
# # 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(librbuscore STATIC SHARED IMPORTED)
# add_dependencies(librbuscore rbuscore)

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

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

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

endif (BUILD_TESTING)

if (NOT BUILD_GIT)
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)
endif ()
endif ()

link_directories ( ${LIBRARY_DIR} ${COMMON_LIBRARY_DIR} ${LIBRARY_DIR64} )
Expand All @@ -232,4 +255,4 @@ add_subdirectory(src)

if (BUILD_TESTING)
add_subdirectory(tests)
endif (BUILD_TESTING)
endif (BUILD_TESTING)
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
8 changes: 3 additions & 5 deletions tests/test_multipart_unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,9 +1141,7 @@ void test_processMsgpackSubdoc_msgpack_failure()

void test_processMsgpackSubdoc_setValues_rbus()
{
webconfigRbusInit("consumerComponent");
regWebConfigDataModel();
int res = rbus_open(&handle, "providerComponent");
int res = rbus_open(&handle, "providerComponent");
if(res != RBUS_ERROR_SUCCESS)
{
CU_FAIL("rbus_open failed for providerComponent");
Expand All @@ -1155,7 +1153,7 @@ void test_processMsgpackSubdoc_setValues_rbus()

rbusError_t ret = rbus_regDataElements(handle, 1, webcfgBlobElement);
CU_ASSERT_EQUAL(ret, RBUS_ERROR_SUCCESS);

webconfigRbusInit("consumerComponent");
SubDocSupportMap_t *supportdocs = (SubDocSupportMap_t *)malloc(sizeof(SubDocSupportMap_t));
if(supportdocs)
{
Expand Down Expand Up @@ -1196,7 +1194,7 @@ void test_processMsgpackSubdoc_setValues_rbus()
CU_ASSERT_EQUAL(result, WEBCFG_SUCCESS);
}
}
webpaRbus_Uninit();
webpaRbus_Uninit();
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions 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 @@ -1784,7 +1783,8 @@ 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 036db7a

Please sign in to comment.