Browse Source

2024.5.9-无fetch_content版本构建

master
Administrator 1 year ago
parent
commit
dbf84faa6a
4 changed files with 20 additions and 8 deletions
  1. +3
    -2
      CMakeLists.txt
  2. +16
    -4
      cmake-linux/grpc.cmake
  3. +1
    -1
      post_processor/post_processor.cc
  4. +0
    -1
      post_processor/post_processor.h

+ 3
- 2
CMakeLists.txt

@ -6,7 +6,7 @@ string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(BoldGreen "${Esc}[1;32m")
set(BoldRed "${Esc}[31m")
#
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC")
set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
option(GRPC "whether to build with gRPC" ON)
@ -17,6 +17,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
if(ONNX)
include(onnx)
endif()
include(openfst)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
@ -29,7 +30,7 @@ add_subdirectory(frontend)
add_subdirectory(post_processor)
add_subdirectory(kaldi) # kaldi:
add_subdirectory(decoder)
#Connection Option
# Connection Option
if(GRPC)
include(grpc)
add_subdirectory(grpc)

+ 16
- 4
cmake-linux/grpc.cmake

@ -8,6 +8,13 @@ if(NOT EXISTS ${grpc_build_dir})
execute_process(
COMMAND cmake
-DgRPC_INSTALL=ON
-DCMAKE_BUILD_TYPE=Release
-DgRPC_PROTOBUF_PROVIDER=package
-DgRPC_CARES_PROVIDER=package
-DgRPC_ABSL_PROVIDER=package
-DgRPC_RE2_PROVIDER=package
-DgRPC_SSL_PROVIDER=package
-DgRPC_ZLIB_PROVIDER=package
-DgRPC_BUILD_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=${grpc_build_dir}
-S ${LIB_BASE_DIR}/grpc-src
@ -20,13 +27,18 @@ if(NOT EXISTS ${grpc_build_dir})
COMMAND cmake --install . -j6
WORKING_DIRECTORY ${grpc_build_dir})
execute_process(
COMMAND cp -r ${LIB_BASE_DIR}/grpc-src/third_party/abseil-cpp/absl ${grpc_build_dir}/include)
COMMAND cp -rf ${LIB_BASE_DIR}/grpc-src/third_party/abseil-cpp/absl ${grpc_build_dir}/include)
message("${BoldGreen}GRPC Installed !${ColourReset}")
endif()
FetchContent_Declare(grpc
SOURCE_DIR ${LIB_BASE_DIR}/grpc-src)
FetchContent_MakeAvailable(grpc)
set(CMAKE_PREFIX_PATH ${grpc_build_dir}
${grpc_build_dir}/grpc/
${grpc_build_dir}/grpc/cmake/
${CMAKE_PREFIX_PATH})
find_package(Threads REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
include_directories(${grpc_build_dir}/include)
# local proto file

+ 1
- 1
post_processor/post_processor.cc

@ -16,7 +16,7 @@
#include "post_processor/post_processor.h"
#include <sstream>
#include <vector>
#include "processor/wetext_processor.h"
//#include "processor/wetext_processor.h"
#include "utils/string.h"
namespace wenet {

+ 0
- 1
post_processor/post_processor.h

@ -19,7 +19,6 @@
#include <memory>
#include <string>
#include <utility>
#include "processor/wetext_processor.h"
#include "utils/utils.h"
namespace wenet {

Loading…
Cancel
Save