Skip to content

Commit 39721ee

Browse files
authored
require c++17 for building with new protobuf (#4947)
1 parent cbd838f commit 39721ee

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tools/caffe/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
find_package(Protobuf)
33

44
if(PROTOBUF_FOUND)
5+
if(DEFINED Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
6+
set(CMAKE_CXX_STANDARD 17)
7+
endif()
8+
59
protobuf_generate_cpp(CAFFE_PROTO_SRCS CAFFE_PROTO_HDRS caffe.proto)
610
add_executable(caffe2ncnn caffe2ncnn.cpp ${CAFFE_PROTO_SRCS} ${CAFFE_PROTO_HDRS})
711
target_include_directories(caffe2ncnn

tools/onnx/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
find_package(Protobuf)
33

44
if(PROTOBUF_FOUND)
5+
if(DEFINED Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
6+
set(CMAKE_CXX_STANDARD 17)
7+
endif()
8+
59
protobuf_generate_cpp(ONNX_PROTO_SRCS ONNX_PROTO_HDRS onnx.proto)
610
add_executable(onnx2ncnn onnx2ncnn.cpp ${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS})
711
target_include_directories(onnx2ncnn

0 commit comments

Comments
 (0)