Skip to content

Commit

Permalink
remove pnnx release
Browse files Browse the repository at this point in the history
  • Loading branch information
Hideousmon committed Oct 28, 2023
1 parent f5ee703 commit d80be49
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 183 deletions.
164 changes: 0 additions & 164 deletions .github/workflows/release-python-pnnx.yml

This file was deleted.

52 changes: 33 additions & 19 deletions tools/pnnx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -565,26 +565,40 @@ set(pnnx_pass_ncnn_SRCS
)


find_package(Protobuf)
if(PROTOBUF_FOUND)
protobuf_generate_cpp(ONNX_PROTO_SRCS ONNX_PROTO_HDRS onnx.proto)

add_library(pnnx2onnx STATIC
save_onnx.cpp
save_onnx_cxxabi_bridge.cpp
${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS}
)

target_include_directories(pnnx2onnx PRIVATE ${PROTOBUF_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(pnnx2onnx PRIVATE ${PROTOBUF_LIBRARIES})

# libtorch is usually compiled with old cxx11 abi
set_source_files_properties(save_onnx_cxxabi_bridge.cpp PROPERTIES COMPILE_FLAGS "${TORCH_CXX_FLAGS}")

message(STATUS "Building with onnx-zero")
else()
message(STATUS "Building without onnx-zero")
endif()
if(DEFINED PROTOBUF_VERSION AND PROTOBUF_VERSION VERSION_GREATER_EQUAL 3.22)
set(CMAKE_CXX_STANDARD 17)
endif()

if(Protobuf_FOUND OR protobuf_MODULE_COMPATIBLE)
protobuf_generate_cpp(ONNX_PROTO_SRCS ONNX_PROTO_HDRS onnx.proto)

add_library(pnnx2onnx STATIC
save_onnx.cpp
save_onnx_cxxabi_bridge.cpp
${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS}
)

target_include_directories(pnnx2onnx PRIVATE ${PROTOBUF_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(pnnx2onnx PRIVATE ${PROTOBUF_LIBRARIES})

# libtorch is usually compiled with old cxx11 abi
set_source_files_properties(save_onnx_cxxabi_bridge.cpp PROPERTIES COMPILE_FLAGS "${TORCH_CXX_FLAGS}")

message(STATUS "Building with onnx-zero")
else()

add_library(pnnx2onnx STATIC
save_onnx.cpp
save_onnx_cxxabi_bridge.cpp
onnx.proto
)
set_source_files_properties(save_onnx_cxxabi_bridge.cpp PROPERTIES COMPILE_FLAGS "${TORCH_CXX_FLAGS}")
target_include_directories(pnnx2onnx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
protobuf_generate(TARGET pnnx2onnx)
target_link_libraries(pnnx2onnx PRIVATE protobuf::libprotobuf)
message(STATUS "Building with onnx-zero")
endif()

set(pnnx_SRCS
main.cpp
Expand Down

0 comments on commit d80be49

Please sign in to comment.