-- remove visibility settings to fix run-time of PyTorch with ONNX -- 'import torch' fails otherwise with undefined symbols from ONNX -- https://github.com/pytorch/pytorch/issues/167525 --- CMakeLists.txt.orig 2025-11-11 00:00:00 UTC +++ CMakeLists.txt @@ -419,8 +419,8 @@ foreach(_proto_src ${ONNX_PROTO_SRCS}) endforeach() # Hide all symbols we don't need -set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) -set_target_properties(onnx_proto PROPERTIES VISIBILITY_INLINES_HIDDEN 1) +#set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden) +#set_target_properties(onnx_proto PROPERTIES VISIBILITY_INLINES_HIDDEN 1) set(LINKED_PROTOBUF_TARGET protobuf::libprotobuf) if(ONNX_USE_LITE_PROTO) @@ -459,8 +459,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") else() add_library(onnx ${ONNX_SRCS}) endif() -set_target_properties(onnx PROPERTIES CXX_VISIBILITY_PRESET hidden) -set_target_properties(onnx PROPERTIES VISIBILITY_INLINES_HIDDEN ON) +#set_target_properties(onnx PROPERTIES CXX_VISIBILITY_PRESET hidden) +#set_target_properties(onnx PROPERTIES VISIBILITY_INLINES_HIDDEN ON) target_link_libraries(onnx PUBLIC onnx_proto) add_onnx_global_defines(onnx)