Skip to content

Commit 76302d8

Browse files
silehtmergify[bot]
authored andcommitted
build: ncnn don't depends on protobuf
1 parent 8ac0db9 commit 76302d8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,19 +693,17 @@ if (USE_NCNN)
693693

694694
set(NCNN_VERSION "20201218")
695695
set(NCNN_TARBALL_HASH "1dac4571168b83ee99efaba969c01e8054cd8e3d9b67ca4893f32b767ab4ec48")
696+
set(NCNN_BUILD_FLAGS -DCMAKE_BUILD_TYPE=Release -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_TESTS=OFF)
696697

697698
if (RPI3)
698699
ExternalProject_Add(
699700
ncnn
700701
PREFIX ncnn
701-
GIT_REPOSITORY https://github.com/tencent/ncnn.git
702-
GIT_TAG ${NCNN_VERSION}
703702
URL https://github.com/Tencent/ncnn/releases/download/${NCNN_VERSION}/ncnn-${NCNN_VERSION}-full-source.zip
704703
URL_HASH SHA256=${NCNN_TARBALL_HASH}
705704
PATCH_COMMAND ${CMAKE_SOURCE_DIR}/cmake/patches-apply.sh ${NCNN_PATCHES}
706-
CMAKE_ARGS -DPI3=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DProtobuf_INCLUDE_DIR=${CMAKE_BINARY_DIR}/protobuf/src/protobuf/src -DProtobuf_LIBRARIES=${PROTOBUF_LIB_DIR}/libprotobuf.so -DProtobuf_PROTOC_EXECUTABLE=${PROTOBUF_LIB_DIR}/protoc -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_TESTS=OFF
705+
CMAKE_ARGS -DPI3=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake ${NCNN_BUILD_FLAGS}
707706
INSTALL_COMMAND ""
708-
DEPENDS protobuf
709707
)
710708
else ()
711709
ExternalProject_Add(
@@ -714,9 +712,8 @@ if (USE_NCNN)
714712
URL https://github.com/Tencent/ncnn/releases/download/${NCNN_VERSION}/ncnn-${NCNN_VERSION}-full-source.zip
715713
URL_HASH SHA256=${NCNN_TARBALL_HASH}
716714
PATCH_COMMAND ${CMAKE_SOURCE_DIR}/cmake/patches-apply.sh ${NCNN_PATCHES}
717-
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DProtobuf_INCLUDE_DIR=${CMAKE_BINARY_DIR}/protobuf/src/protobuf/src -DProtobuf_LIBRARIES=${PROTOBUF_LIB_DIR}/libprotobuf.so -DProtobuf_PROTOC_EXECUTABLE=${PROTOBUF_LIB_DIR}/protoc -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_TESTS=OFF
715+
CMAKE_ARGS ${NCNN_BUILD_FLAGS}
718716
INSTALL_COMMAND ""
719-
DEPENDS protobuf
720717
)
721718
endif()
722719

0 commit comments

Comments
 (0)