Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)
project(ctrlm-main VERSION ${CMAKE_PROJECT_VERSION})

# OPTIONS
option(BUILD_LIBRARY "Build Control Manager Library" OFF)
option(IARMBUS_ENABLED "Enable IARMBUS Support" ON)
option(AUTH_ENABLED "Enable AUTH" OFF)
option(BLE_ENABLED "Enable BLE" ON)
option(BLE_SERVICES "Enable BLE Services" OFF)
Expand Down Expand Up @@ -67,7 +69,12 @@ set(BEEP_ON_KWD_FILE "NONE" CACHE STRING "Keyword Beep file name")
set(CMAKE_ENABLE_EXPORTS ON)

# EXECUTABLE(S)
add_executable(controlMgr src/ctrlm_config_default.json ctrlm_version_build.h ctrlm_config_default.h ${CMAKE_CURRENT_SOURCE_DIR}/src/ctrlm_config_default.c)
if(BUILD_LIBRARY)
add_library(controlMgr SHARED src/ctrlm_config_default.json ctrlm_version_build.h ctrlm_config_default.h ${CMAKE_CURRENT_SOURCE_DIR}/src/ctrlm_config_default.c)
add_compile_definitions(BUILD_LIBRARY)
else()
add_executable(controlMgr src/ctrlm_config_default.json ctrlm_version_build.h ctrlm_config_default.h ${CMAKE_CURRENT_SOURCE_DIR}/src/ctrlm_config_default.c)
endif()

if(BUILD_CTRLM_FACTORY)
add_library(ctrlm-fta)
Expand Down Expand Up @@ -112,9 +119,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SYSROOT}/usr/include/glib-2.0
${CMAKE_SYSROOT}/usr/lib/glib-2.0/include
${CMAKE_SYSROOT}/usr/include/gio-unix-2.0
${CMAKE_SYSROOT}/usr/include/rdk/iarmbus
${CMAKE_SYSROOT}/usr/include/nopoll
${CMAKE_SYSROOT}/usr/include/rdk/iarmmgrs-hal
${CMAKE_SYSROOT}/usr/include/wdmp-c
${CMAKE_SYSROOT}/usr/include/rdk/ds
${CMAKE_SYSROOT}/usr/include/rdk/ds-rpc
Expand All @@ -124,6 +129,14 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SYSROOT}/usr/include/breakpad
)

if(IARMBUS_ENABLED)
include_directories( ${CMAKE_SYSROOT}/usr/include/rdk/iarmbus
${CMAKE_SYSROOT}/usr/include/rdk/iarmmgrs-hal
)
add_compile_definitions(IARMBUS_ENABLED)
target_link_libraries(controlMgr IARMBus)
endif()

# SOURCES
add_subdirectory(src)

Expand All @@ -150,7 +163,6 @@ target_link_libraries(
jansson
dbus-1
uuid
IARMBus
ds
nopoll
ssl
Expand Down
37 changes: 25 additions & 12 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ set(project "ctrlm-main")

target_sources(controlMgr PRIVATE
ctrlm_main.cpp
ctrlm_main_iarm.cpp
ctrlm_utils.cpp
ctrlm_network.cpp
ctrlm_controller.cpp
ctrlm_ir_controller.cpp
ctrlm_powermanager_factory.cpp
ctrlm_rcu.cpp
ctrlm_rcu_iarm.cpp
attributes/ctrlm_attr.cpp
attributes/ctrlm_attr_general.cpp
attributes/ctrlm_attr_voice.cpp
Expand All @@ -39,13 +37,10 @@ target_sources(controlMgr PRIVATE
config/ctrlm_config_types.cpp
ctrlm_controller.cpp
ctrlm_device_update.cpp
ctrlm_device_update_iarm.cpp
ctrlm_ir_controller.cpp
ctrlm_main.cpp
ctrlm_main_iarm.cpp
ctrlm_network.cpp
ctrlm_rcu.cpp
ctrlm_rcu_iarm.cpp
ctrlm_recovery.cpp
ctrlm_tr181.cpp
ctrlm_utils.cpp
Expand All @@ -63,11 +58,9 @@ target_sources(controlMgr PRIVATE
database/ctrlm_db_attr.cpp
database/ctrlm_db_types.cpp
input_event/ctrlm_input_event_writer.cpp
ipc/ctrlm_ipc_iarm.cpp
ipc/ctrlm_rcp_ipc_event.cpp
irdb/ctrlm_irdb_stub.cpp
irdb/ctrlm_irdb_interface.cpp
irdb/ipc/ctrlm_irdb_ipc_iarm_thunder.cpp
json_config.cpp
network/ctrlm_ir_rf_db.cpp
network/ctrlm_ir_rf_db_entry.cpp
Expand All @@ -79,15 +72,30 @@ target_sources(controlMgr PRIVATE
voice/endpoints/ctrlm_voice_endpoint.cpp
voice/endpoints/ctrlm_voice_endpoint_ws_nextgen.cpp
voice/endpoints/ctrlm_voice_endpoint_ws_nsp.cpp
voice/ipc/ctrlm_voice_ipc_iarm_all.cpp
voice/ipc/ctrlm_voice_ipc_iarm_legacy.cpp
)

if(IARMBUS_ENABLED)
target_sources(controlMgr PRIVATE
ctrlm_main_iarm.cpp
ctrlm_rcu_iarm.cpp
ctrlm_device_update_iarm.cpp
ctrlm_main_iarm.cpp
ipc/ctrlm_ipc_iarm.cpp
irdb/ipc/ctrlm_irdb_ipc_iarm_thunder.cpp
voice/ipc/ctrlm_voice_ipc_iarm_all.cpp
voice/ipc/ctrlm_voice_ipc_iarm_legacy.cpp
)
if(BLE_ENABLED)
target_sources(controlMgr PRIVATE
ble/ctrlm_ble_iarm.cpp
)
endif()
endif()

if(BLE_ENABLED)
target_sources(controlMgr PRIVATE
ble/ctrlm_ble_controller.cpp
ble/ctrlm_ble_controller_attr_version.cpp
ble/ctrlm_ble_iarm.cpp
ble/ctrlm_ble_network.cpp
ble/ctrlm_ble_rcu_interface.cpp
ble/ctrlm_ble_utils.cpp
Expand Down Expand Up @@ -200,10 +208,15 @@ if(THUNDER)
thunder/plugins/ctrlm_thunder_plugin_av_input.cpp
thunder/plugins/ctrlm_thunder_plugin_hdmi_input.cpp
thunder/plugins/ctrlm_thunder_plugin_system.cpp
ipc/ctrlm_rcp_ipc_iarm_thunder.cpp
voice/ipc/ctrlm_voice_ipc_iarm_thunder.cpp
voice/ipc/ctrlm_voice_ipc_request_type.c
)
if(IARMBUS_ENABLED)
target_sources(controlMgr PRIVATE
ipc/ctrlm_rcp_ipc_iarm_thunder.cpp
voice/ipc/ctrlm_voice_ipc_iarm_thunder.cpp
)
endif()


if(AUTH_ENABLED)
target_sources(controlMgr PRIVATE
Expand Down
2 changes: 2 additions & 0 deletions src/ctrlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
#include "ctrlm_ipc_voice.h"
#include "ctrlm_ipc_device_update.h"
#include "ctrlm_irdb_interface.h"
#ifdef IARMBUS_ENABLED
#include "libIBus.h"
#endif
#include "safec_lib.h"

#define CTRLM_MAIN_QUEUE_MSG_TYPE_GLOBAL (0x100)
Expand Down
4 changes: 4 additions & 0 deletions src/ctrlm_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ gboolean ctrlm_is_production_build(void) {
return(g_ctrlm.production_build);
}

#ifdef BUILD_LIBRARY
int ctrlm_main_launch(void) {
#else
int main(int argc, char *argv[]) {
#endif
// Set stdout to be line buffered
setvbuf(stdout, NULL, _IOLBF, 0);

Expand Down
Loading