Compare commits

...

2 Commits

Author SHA1 Message Date
baigao-X
7d7320f0b7
feat: generating debug files during linux release builds (#4308)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
linux release构建时生成与MediaServer 匹配的debug文件。
生产环境依然使用小尺寸的MediaServer,在需要gdb调试或者查看coredump文件时可以结合debug文件查看调用栈。
2025-06-07 15:01:42 +08:00
Haibo Chen(陈海博)
6e125d02dc
Fix typo (#4307) 2025-06-07 15:00:06 +08:00
3 changed files with 27 additions and 2 deletions

View File

@ -198,7 +198,12 @@ if(UNIX)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(COMPILE_OPTIONS_DEFAULT ${COMPILE_OPTIONS_DEFAULT} "-g3")
else()
set(COMPILE_OPTIONS_DEFAULT ${COMPILE_OPTIONS_DEFAULT} "-g0")
find_program(OBJCOPY_FOUND objcopy)
if (OBJCOPY_FOUND)
set(COMPILE_OPTIONS_DEFAULT ${COMPILE_OPTIONS_DEFAULT} "-g3")
else()
set(COMPILE_OPTIONS_DEFAULT ${COMPILE_OPTIONS_DEFAULT} "-g0")
endif()
endif()
elseif(WIN32)
if (MSVC)

View File

@ -66,3 +66,23 @@ else()
endif()
install(TARGETS MediaServer DESTINATION ${INSTALL_PATH_RUNTIME})
#relase debug
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
if(UNIX)
if("${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
find_program(OBJCOPY_FOUND objcopy)
if (OBJCOPY_FOUND)
add_custom_command(TARGET MediaServer
POST_BUILD
COMMAND objcopy --only-keep-debug ${EXECUTABLE_OUTPUT_PATH}/MediaServer ${EXECUTABLE_OUTPUT_PATH}/MediaServer.debug
COMMAND objcopy --strip-all ${EXECUTABLE_OUTPUT_PATH}/MediaServer
COMMAND objcopy --add-gnu-debuglink=${EXECUTABLE_OUTPUT_PATH}/MediaServer.debug ${EXECUTABLE_OUTPUT_PATH}/MediaServer
)
install(FILES ${EXECUTABLE_OUTPUT_PATH}/MediaServer.debug DESTINATION ${INSTALL_PATH_RUNTIME})
else()
message(STATUS "not found objcopy, generate MediaServer.debug skip")
endif()
endif()
endif()

View File

@ -125,7 +125,7 @@ public:
kUdpActive = 1, // udp主动模式主动发送数据给对方
kTcpPassive = 2, // tcp被动模式tcp服务器等待对方连接并回复rtp
kUdpPassive = 3, // udp被动方式等待对方发送nat打洞包然后回复rtp至打洞包源地址
kVoiceTalk = 4, // 语音对讲模式,对方必须推流上来通过他的推流链路再回复rtp数据
kVoiceTalk = 4, // 语音对讲模式,对方必须推流上来通过他的推流链路再回复rtp数据
};
// rtp类型 [AUTO-TRANSLATED:acca40ab]