parent
7489e399f1
commit
f51a0523a0
@ -1,8 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
add_executable(glog_main ${CMAKE_CURRENT_SOURCE_DIR}/glog_main.cc)
|
||||
target_link_libraries(glog_main glog)
|
||||
target_link_libraries(glog_main extern_glog)
|
||||
|
||||
|
||||
add_executable(glog_logtostderr_main ${CMAKE_CURRENT_SOURCE_DIR}/glog_logtostderr_main.cc)
|
||||
target_link_libraries(glog_logtostderr_main glog)
|
||||
target_link_libraries(glog_logtostderr_main extern_glog)
|
||||
|
@ -0,0 +1,29 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
|
||||
namespace ppspeech {
|
||||
|
||||
pid_t GetPid() {
|
||||
return getpid();
|
||||
}
|
||||
|
||||
void GetPrpocessName(const pid_t pid, std::string& name){
|
||||
char tmp[256];
|
||||
sprintf(tmp, "/proc/%d/cmdline", pid);
|
||||
|
||||
FILE* f = fopen(tmp, "r");
|
||||
if(f){
|
||||
size_t size;
|
||||
size = fread(name.data(), sizeof(char), sizeof(tmp), f);
|
||||
if(size > 0){
|
||||
if ('\n' == tmp[size-1]){
|
||||
tmp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ppspeech
|
@ -1,4 +1,4 @@
|
||||
add_executable(infer_onnx_silero_vad ${CMAKE_CURRENT_SOURCE_DIR}/infer_onnx_silero_vad.cc wav.h vad.cc vad.h)
|
||||
|
||||
# 添加FastDeploy库依赖
|
||||
target_link_libraries(infer_onnx_silero_vad ${FASTDEPLOY_LIBS} gflags glog)
|
||||
target_link_libraries(infer_onnx_silero_vad ${FASTDEPLOY_LIBS} gflags extern_glog)
|
||||
|
Loading…
Reference in new issue