Skip to content

Commit

Permalink
require c++17 for building with new protobuf (#4947)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Aug 16, 2023
1 parent cbd838f commit 39721ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/caffe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
find_package(Protobuf)

if(PROTOBUF_FOUND)
if(DEFINED Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
set(CMAKE_CXX_STANDARD 17)
endif()

protobuf_generate_cpp(CAFFE_PROTO_SRCS CAFFE_PROTO_HDRS caffe.proto)
add_executable(caffe2ncnn caffe2ncnn.cpp ${CAFFE_PROTO_SRCS} ${CAFFE_PROTO_HDRS})
target_include_directories(caffe2ncnn
Expand Down
4 changes: 4 additions & 0 deletions tools/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
find_package(Protobuf)

if(PROTOBUF_FOUND)
if(DEFINED Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
set(CMAKE_CXX_STANDARD 17)
endif()

protobuf_generate_cpp(ONNX_PROTO_SRCS ONNX_PROTO_HDRS onnx.proto)
add_executable(onnx2ncnn onnx2ncnn.cpp ${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS})
target_include_directories(onnx2ncnn
Expand Down

0 comments on commit 39721ee

Please sign in to comment.