Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
44fd6b86
Commit
44fd6b86
authored
Nov 06, 2022
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善版本信息
parent
04e2952d
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
6 行删除
+19
-6
CMakeLists.txt
+12
-4
server/main.cpp
+3
-0
src/Common/macros.cpp
+3
-2
version.h.ini
+1
-0
没有找到文件。
CMakeLists.txt
查看文件 @
44fd6b86
...
...
@@ -97,11 +97,12 @@ set(LIBRARY_OUTPUT_PATH ${OUTPUT_DIR})
set
(
EXECUTABLE_OUTPUT_PATH
${
OUTPUT_DIR
}
)
# 添加 git 版本信息
set
(
COMMIT_HASH
"Git_NotFound_Unkown_commit"
)
set
(
BRANCH_NAME
"Git_NotFound_Unkown_branch"
)
set
(
COMMIT_HASH
"Git_Unkown_commit"
)
set
(
COMMIT_TIME
"Git_Unkown_time"
)
set
(
BRANCH_NAME
"Git_Unkown_branch"
)
set
(
BUILD_TIME
""
)
string
(
TIMESTAMP BUILD_TIME
"%Y-%m-%d
%H:%M:%S"
)
string
(
TIMESTAMP BUILD_TIME
"%Y-%m-%d
T
%H:%M:%S"
)
find_package
(
Git QUIET
)
if
(
GIT_FOUND
)
...
...
@@ -117,6 +118,13 @@ if(GIT_FOUND)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
log --format=format:%aI -1
OUTPUT_VARIABLE COMMIT_TIME
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endif
()
configure_file
(
...
...
@@ -124,7 +132,7 @@ configure_file(
${
CMAKE_CURRENT_BINARY_DIR
}
/version.h
@ONLY
)
message
(
STATUS
"Git version is
${
BRANCH_NAME
}
:
${
COMMIT_HASH
}
:
${
BUILD_TIME
}
"
)
message
(
STATUS
"Git version is
${
BRANCH_NAME
}
${
COMMIT_HASH
}
/
${
COMMIT_TIME
}
${
BUILD_TIME
}
"
)
##############################################################################
...
...
server/main.cpp
查看文件 @
44fd6b86
...
...
@@ -222,6 +222,9 @@ int start_main(int argc,char *argv[]) {
//启动异步日志线程
Logger
::
Instance
().
setWriter
(
std
::
make_shared
<
AsyncLogWriter
>
());
InfoL
<<
kServerName
;
//加载配置文件,如果配置文件不存在就创建一个
loadIniConfig
(
g_ini_file
.
data
());
...
...
src/Common/macros.cpp
查看文件 @
44fd6b86
...
...
@@ -35,9 +35,9 @@ namespace mediakit {
//请遵循MIT协议,勿修改服务器声明
#if !defined(ENABLE_VERSION)
const
char
kServerName
[]
=
"ZLMediaKit-
6
.0(build in "
__DATE__
" "
__TIME__
")"
;
const
char
kServerName
[]
=
"ZLMediaKit-
7
.0(build in "
__DATE__
" "
__TIME__
")"
;
#else
const
char
kServerName
[]
=
"ZLMediaKit(git hash:"
COMMIT_HASH
"
,branch:"
BRANCH_NAME
",build time:"
__DATE__
" "
__TIME__
")"
;
const
char
kServerName
[]
=
"ZLMediaKit(git hash:"
COMMIT_HASH
"
/"
COMMIT_TIME
",branch:"
BRANCH_NAME
",build time:"
BUILD_TIME
")"
;
#endif
}
//
namespace
mediakit
\ No newline at end of file
version.h.ini
查看文件 @
44fd6b86
...
...
@@ -2,6 +2,7 @@
#define __GIT_VERSION_H__
#define COMMIT_HASH "@COMMIT_HASH@"
#define COMMIT_TIME "@COMMIT_TIME@"
#define BRANCH_NAME "@BRANCH_NAME@"
#define BUILD_TIME "@BUILD_TIME@"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论