Skip to content

Commit 8ec1ba7

Browse files
committed
wa for debian9
1 parent 1a0a65e commit 8ec1ba7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

thirdparty/onnx/CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ endif()
5252
# from onnx==1.13.1 it requires C++17 when compiling on Windows, and since onnx==1.16.0 on Linux
5353
target_compile_features(onnx PRIVATE cxx_std_17)
5454

55+
# WA to allow build on Debian 9
56+
if(CMAKE_COMPILER_IS_GNUCXX AND LINUX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
57+
file(READ onnx/onnx/common/file_utils.h CONTENT)
58+
string(REPLACE "#include <filesystem>" "" CONTENT "${CONTENT}")
59+
string(REPLACE "std::filesystem::path proto_u8_path = std::filesystem::u8path(proto_path);" "" CONTENT "${CONTENT}")
60+
string(REPLACE "proto_u8_path" "proto_path" CONTENT "${CONTENT}")
61+
file(WRITE onnx/onnx/common/file_utils.h "${CONTENT}")
62+
63+
file(READ onnx/onnx/defs/traditionalml/utils.h CONTENT)
64+
string(REPLACE "const auto& [type, length]" "const std::pair<int, int>& type_length" CONTENT "${CONTENT}")
65+
string(REPLACE "type !=" "type_length.first !=" CONTENT "${CONTENT}")
66+
string(REPLACE "length !=" "type_length.second !=" CONTENT "${CONTENT}")
67+
file(WRITE onnx/onnx/defs/traditionalml/utils.h "${CONTENT}")
68+
endif()
69+
5570
ov_disable_all_warnings(onnx onnx_proto)
5671

5772
# install

0 commit comments

Comments
 (0)