cmake_minimum_required(VERSION 3.1.3)
project(fdbus C CXX)
option(fdbus_ENABLE_LOG "Enable log" ON)
option(fdbus_LOG_TO_STDOUT "Log to stdout" OFF)
option(fdbus_SOCKET_ENABLE_PEERCRED "Enable peercred of socket" ON)
option(fdbus_ALLOC_PORT_BY_SYSTEM "Allocate port number by system rather than by name server" OFF)
option(fdbus_SECURITY "Enable security of FDBus" OFF)
option(fdbus_ANDROID "build Android version" OFF)
option(fdbus_PIPE_AS_EVENTFD "Do not use event FD" OFF)
option(fdbus_BUILD_JNI "Build jni" OFF)
option(fdbus_LINK_SOCKET_LIB "specify -lsocket to link" OFF)
option(fdbus_LINK_PTHREAD_LIB "specify -lpthread to link" ON)
option(fdbus_BUILD_CLIB "build library for C" ON)
option(fdbus_FORCE_NO_RTTI "forced to build without rtti" ON)
option(fdbus_UDS_ABSTRACT "using abstract address for UDS" OFF)
option(fdbus_QNX_KEEPALIVE "QNX style keepalive for TCP" OFF)
option(fdbus_QNX_DIRENT "QNX style directory entry" OFF)
if (MSVC)
add_definitions("-D__WIN32__")
elseif(fdbus_ANDROID)
add_definitions("-D__LINUX__")
else()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=gnu++11 -Wall ${CMAKE_CXX_FLAGS}")
endif()
#add_compile_options(-g -O0)
add_definitions("-D__LINUX__")
endif()
if (fdbus_ENABLE_LOG)
add_definitions("-DCONFIG_DEBUG_LOG")
endif()
if (fdbus_LOG_TO_STDOUT)
add_definitions("-DCONFIG_LOG_TO_STDOUT")
endif()
if (fdbus_SOCKET_ENABLE_PEERCRED)
add_definitions("-DCONFIG_SOCKET_PEERCRED")
endif()
if (fdbus_ALLOC_PORT_BY_SYSTEM)
add_definitions("-DCFG_ALLOC_PORT_BY_SYSTEM")
endif()
if (fdbus_SECURITY)
add_definitions("-DCFG_FDBUS_SECURITY")
endif()
if (fdbus_PIPE_AS_EVENTFD)
add_definitions("-DCFG_PIPE_AS_EVENTFD")
endif()
if (fdbus_FORCE_NO_RTTI)
add_definitions("-DCONFIG_FDB_NO_RTTI")
endif()
if (fdbus_UDS_ABSTRACT)
add_definitions("-DFDB_CONFIG_UDS_ABSTRACT")
endif()
if (fdbus_QNX_KEEPALIVE)
add_definitions("-DCONFIG_QNX_KEEPALIVE")
endif()
if (fdbus_QNX_DIRENT)
add_definitions("-DCONFIG_QNX_DIRENT")
endif()
if(DEFINED RULE_DIR)
include(${RULE_DIR}/rule_base.cmake)
else()
set(RULE_DIR ${CMAKE_SOURCE_DIR})
include(rule_base.cmake)
endif()
get_filename_component(PACKAGE_SOURCE_ROOT ${CMAKE_SOURCE_DIR} PATH)
print_variable(PACKAGE_SOURCE_ROOT)
set(IDL_GEN_ROOT ${CMAKE_CURRENT_BINARY_DIR})
file(GLOB FDBUS_SOURCES "${PACKAGE_SOURCE_ROOT}/fdbus/*.cpp")
if (MSVC)
file(GLOB PLATFORM_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/win/*.cpp")
else()
file(GLOB PLATFORM_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/linux/*.cpp")
endif()
if (MSVC)
set(EVENTFD_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/CEventFd_pipe.cpp")
else()
if (fdbus_PIPE_AS_EVENTFD)
set(EVENTFD_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/CEventFd_pipe.cpp")
else()
set(EVENTFD_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/CEventFd_eventfd.cpp")
endif()
endif()
file(GLOB_RECURSE SOCKET_SOURCES "${PACKAGE_SOURCE_ROOT}/platform/socket/*.cpp")
file(GLOB UTILS_SOURCES "${PACKAGE_SOURCE_ROOT}/utils/*.cpp")
file(GLOB WORKER_SOURCES "${PACKAGE_SOURCE_ROOT}/worker/*.cpp")
file(GLOB PUBLIC_HEADERS "${PACKAGE_SOURCE_ROOT}/common_base/*.h")
set(SECURITY_SOURCES
${PACKAGE_SOURCE_ROOT}/security/CApiSecurityConfig.cpp
${PACKAGE_SOURCE_ROOT}/security/CFdbToken.cpp
${PACKAGE_SOURCE_ROOT}/security/CFdbusSecurityConfig.cpp
)
set(OTHER_SOURCES
${PACKAGE_SOURCE_ROOT}/utils/cJSON/cJSON.c
${PACKAGE_SOURCE_ROOT}/utils/CBaseNameProxy.cpp
${PACKAGE_SOURCE_ROOT}/log/CLogProducer.cpp
${PACKAGE_SOURCE_ROOT}/log/CLogPrinter.cpp
${PACKAGE_SOURCE_ROOT}/log/CFdbLogCache.cpp
)
include_directories(
${PACKAGE_SOURCE_ROOT}
${PACKAGE_SOURCE_ROOT}/public
)
if (MSVC)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
link_libraries(ws2_32.lib)
set(LIB_BUILD_TYPE "STATIC")
else()
if (fdbus_LINK_PTHREAD_LIB)
link_libraries(pthread)
endif()
if (fdbus_LINK_SOCKET_LIB)
link_libraries(socket)
endif()
set(LIB_BUILD_TYPE "SHARED")
endif()
add_library(common_base ${LIB_BUILD_TYPE}
${FDBUS_SOURCES}
${PLATFORM_SOURCES}
${EVENTFD_SOURCES}
${SOCKET_SOURCES}
${UTILS_SOURCES}
${WORKER_SOURCES}
${OTHER_SOURCES}
${SECURITY_SOURCES}
)
install(TARGETS common_base DESTINATION usr/lib)
install(DIRECTORY ${PACKAGE_SOURCE_ROOT}/public/common_base/ DESTINATION usr/include/common_base)
install(FILES ${PACKAGE_SOURCE_ROOT}/python/fdbus.py DESTINATION usr/share/fdbus)
include(service.cmake)
if (fdbus_BUILD_JNI)
include(jni.cmake)
endif()
if (fdbus_BUILD_CLIB)
include(clib.cmake)
endif()
#set( CMAKE_VERBOSE_MAKEFILE on )
print_variable(fdbus_ENABLE_LOG)
print_variable(fdbus_LOG_TO_STDOUT)
print_variable(fdbus_SOCKET_ENABLE_PEERCRED)
print_variable(fdbus_ALLOC_PORT_BY_SYSTEM)
print_variable(fdbus_SECURITY)
print_variable(fdbus_ANDROID)
print_variable(fdbus_PIPE_AS_EVENTFD)
print_variable(fdbus_BUILD_JNI)
print_variable(fdbus_LINK_SOCKET_LIB)
print_variable(fdbus_LINK_PTHREAD_LIB)
print_variable(fdbus_BUILD_CLIB)
没有合适的资源?快使用搜索试试~ 我知道了~
fdbus:FDBus-快速分布式总线
共247个文件
h:86个
cpp:81个
java:21个
5星 · 超过95%的资源 需积分: 50 25 下载量 100 浏览量
2021-05-05
22:33:37
上传
评论 3
收藏 1.69MB ZIP 举报
温馨提示
介绍 FDBus是一个易于使用,重量轻且高性能的IPC框架。 它类似于DBus或SOME/IP ,但是具有自己的特征: 分布式:与DBus不同,它没有中央集线器。 客户和服务对象直接连接 高性能:端点之间可以直接对话 按名称寻址:服务可通过逻辑名称寻址 地址分配:服务地址是动态分配的 联网:主机内部和整个网络之间的通信 IDL和代码生成:建议使用Google协议缓冲区 语言绑定:C ++ C Java Python 总的解决方案:它不只是IPC 。 它更像是一个中间件开发框架 通知中心:除分布式服务外,还支持MQTT等集中式通知中心 记录和调试:所有FDBus消息都可以被过滤和记录。 可以监视服务; 可以列出已连接的客户端... 可以在以下字段中找到其用法: 信息娱乐; 组合仪表,TBox和其他具有posix兼容OS的ECU正在运行 虚拟机管理程序中来宾OS之间的VM间通信 SO
资源详情
资源评论
资源推荐
收起资源包目录
fdbus:FDBus-快速分布式总线 (247个子文件)
make.bat 7KB
Android.bp 19KB
cJSON.c 72KB
fdbus_test_server.c 4KB
fdbus_test_afcomponent_server.c 3KB
fdbus_test_afcomponent_client.c 3KB
fdbus_test_client.c 3KB
dummy.c 0B
dummy.c 0B
rule_base.cmake 3KB
rule_base.cmake 3KB
service.cmake 2KB
idl-gen.cmake 1KB
example.cmake 1KB
idl-gen.cmake 1KB
jni.cmake 1002B
example.cmake 860B
clib-test.cmake 549B
clib.cmake 159B
toolchain.cmake 130B
toolchain.cmake 130B
CFdbBaseObject.cpp 51KB
CNameServer.cpp 46KB
CFdbMessage.cpp 33KB
sckt.cpp 30KB
client_server_object.cpp 25KB
fdb_log_config.cpp 24KB
CIntraNameProxy.cpp 23KB
CJniClient.cpp 23KB
CFdbSession.cpp 23KB
CBaseEndpoint.cpp 22KB
CBaseWorker.cpp 19KB
CLogProducer.cpp 18KB
fdb_test_client.cpp 17KB
fdbus_client.cpp 16KB
FdbusGlobal.cpp 16KB
main_xclient.cpp 14KB
CHostProxy.cpp 14KB
fdb_appfw_test.cpp 14KB
main_log_server.cpp 13KB
CServerSecurityConfig.cpp 13KB
CJniServer.cpp 13KB
fdb_test_notification_center.cpp 12KB
CEventSubscribeHandle.cpp 12KB
CFdEventLoop.cpp 11KB
CInterNameProxy.cpp 11KB
fdb_test_server.cpp 11KB
CHostServer.cpp 10KB
CBaseServer.cpp 10KB
CBaseClient.cpp 9KB
CHostSecurityConfig.cpp 9KB
CLinuxSocket.cpp 9KB
CApiSecurityConfig.cpp 9KB
CLogFileManager.cpp 8KB
fdbus_server.cpp 8KB
main_ls.cpp 8KB
CFdbAFComponent.cpp 7KB
main_log_client.cpp 7KB
CFdbMsgDispatcher.cpp 7KB
CBaseSocketFactory.cpp 6KB
main_lc.cpp 6KB
CSysFdWatch.cpp 6KB
CJniAFComponent.cpp 6KB
CBaseEventLoop.cpp 6KB
main_lh.cpp 6KB
CFdbSessionContainer.cpp 6KB
CFdbSimpleSerializer.cpp 6KB
CFdbUDPSession.cpp 5KB
fdbus_afcomponent.cpp 5KB
fdb_option_parser.cpp 5KB
CJniMessage.cpp 5KB
main_xserver.cpp 5KB
CFdbContext.cpp 5KB
main_le.cpp 4KB
main_ns.cpp 4KB
CBaseSysDep.cpp 4KB
CBasePipe.cpp 4KB
CFdbusSecurityConfig.cpp 4KB
CBaseThread.cpp 4KB
CLogPrinter.cpp 4KB
CFdbLogCache.cpp 4KB
CFdbWatchdog.cpp 4KB
CBaseThread.cpp 4KB
CFdbBaseContext.cpp 4KB
CFdbToken.cpp 4KB
CAddressAllocator.cpp 3KB
job_test.cpp 3KB
CFdbEventRouter.cpp 3KB
CBasePipe.cpp 3KB
main_nc.cpp 3KB
CBaseSysDep.cpp 3KB
CBaseSemaphore.cpp 2KB
CFdbCJsonMsgBuilder.cpp 2KB
CThreadEventLoop.cpp 2KB
CBaseNameProxy.cpp 2KB
main_hs.cpp 2KB
CBaseSemaphore.cpp 2KB
CBaseMutexLock.cpp 2KB
fdbus_clib.cpp 2KB
CBaseMutexLock.cpp 1KB
共 247 条
- 1
- 2
- 3
林John
- 粉丝: 47
- 资源: 4601
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论5