File: onnx-shared-libraries.patch

package info (click to toggle)
guix 1.4.0-9
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 161,500 kB
  • sloc: lisp: 861,023; cpp: 10,741; javascript: 9,632; sh: 8,913; makefile: 951; ansic: 558; python: 129; sql: 33; sed: 16
file content (24 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
These linker options for the 'onnx_cpp2py_export.cpython-38-*-gnu.so'
(or similar) extension are meant to be used when building 'libonn.a',
a static archive.  This patch adapts the link flags to linking with
'libonnx.so'.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cede3073..52f846ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -475,11 +475,10 @@ if(BUILD_ONNX_PYTHON)
                           PRIVATE $<TARGET_OBJECTS:onnx>)
   else()
     # Assume everything else is like gcc
-    target_link_libraries(onnx_cpp2py_export
-                          PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx>
-                                  "-Wl,--no-whole-archive")
+    target_link_libraries(onnx_cpp2py_export PRIVATE onnx)
     set_target_properties(onnx_cpp2py_export
-                          PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
+                          PROPERTIES LINK_FLAGS
+			  "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
   endif()
 
   target_link_libraries(onnx_cpp2py_export PRIVATE onnx)