From 89bf891ba6f2c902e2eafbb882e136208052094a Mon Sep 17 00:00:00 2001 From: nekosu Date: Wed, 11 Oct 2023 20:24:03 +0800 Subject: [PATCH] ci: some fix --- CMakeLists.txt | 9 +++++---- cmake/thrift-gen.cmake | 2 +- cmake/utils.cmake | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fddbf0f6..ac989b5a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,10 @@ option(BUILD_SAMPLE "build a demo" OFF) option(WITH_THRIFT "build with thrift" ON) option(WITH_GRPC "build with protobuf and grpc" ON) +if(USE_MAADEPS) + include(${PROJECT_SOURCE_DIR}/MaaDeps/maadeps.cmake) +endif() + # Basic compile and link configuration include(${PROJECT_SOURCE_DIR}/cmake/config.cmake) include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake) @@ -25,9 +29,6 @@ if(WITH_GRPC) include(${PROJECT_SOURCE_DIR}/cmake/grpc-gen.cmake) endif() -if(USE_MAADEPS) - include(${PROJECT_SOURCE_DIR}/MaaDeps/maadeps.cmake) -endif() find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs) find_package(Boost REQUIRED COMPONENTS system) find_package(ZLIB REQUIRED) @@ -37,7 +38,7 @@ if(WITH_THRIFT) find_package(Thrift CONFIG REQUIRED) endif() if(WITH_GRPC) - find_package(protobuf CONFIG) # protoc cannot been found on arm + find_package(protobuf CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED) endif() diff --git a/cmake/thrift-gen.cmake b/cmake/thrift-gen.cmake index f795df4ee..60799fc80 100644 --- a/cmake/thrift-gen.cmake +++ b/cmake/thrift-gen.cmake @@ -6,7 +6,7 @@ macro(GENERATE_THRIFT_LIB LIB_NAME FILENAME OUTPUTDIR SOURCES) execute_process(COMMAND ${THRIFT_COMPILER} --gen cpp:no_skeleton -out ${OUTPUTDIR} ${FILENAME} RESULT_VARIABLE CMD_RESULT) if(CMD_RESULT) - message(FATAL_ERROR "Error generating ${FILENAME} with generator ${GENERATOR}") + message("Error generating ${FILENAME} with generator ${GENERATOR}") endif() file(GLOB_RECURSE GENERATED_SOURCES ${OUTPUTDIR}/*.cpp) add_library(${LIB_NAME} STATIC ${GENERATED_SOURCES}) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 1e1ce6d90..a6d35f388 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -46,4 +46,7 @@ else() set(MAADEPS_HOST_TRIPLET "x64-linux") endif() set(MAADEPS_HOST_TOOLS ${PROJECT_SOURCE_DIR}/MaaDeps/vcpkg/installed/${MAADEPS_HOST_TRIPLET}/tools) +if(NOT DEFINED MAADEPS_TRIPLET) + detect_maadeps_triplet(MAADEPS_TRIPLET) +endif() set(MAADEPS_TARGET_TOOLS ${PROJECT_SOURCE_DIR}/MaaDeps/vcpkg/installed/${MAADEPS_TRIPLET}/tools)