aboutsummaryrefslogtreecommitdiffstats
path: root/misc/onnx/files/patch-CMakeLists.txt
blob: f1e4a2c51f35e26fe80d95b9d1bb936d22135100 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- 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)