File: 1050-use-system-httplib.patch

package info (click to toggle)
pytorch-cuda 2.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 161,620 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (31 lines) | stat: -rw-r--r-- 1,213 bytes parent folder | download | duplicates (3)
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
29
30
31
Description: use system cpp-httplib instead.
Forwarded: not-needed

Index: pytorch/cmake/Dependencies.cmake
===================================================================
--- pytorch.orig/cmake/Dependencies.cmake
+++ pytorch/cmake/Dependencies.cmake
@@ -1687,8 +1687,9 @@ endif()
 include(${CMAKE_CURRENT_LIST_DIR}/FlatBuffers.cmake)
 
 # Include cpp-httplib
-add_library(httplib INTERFACE IMPORTED)
-target_include_directories(httplib SYSTEM INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpp-httplib)
+add_library(httplib SHARED IMPORTED)
+find_library(HTTPLIB_LIBRARY cpp-httplib REQUIRED)
+set_property(TARGET httplib PROPERTY IMPORTED_LOCATION "${HTTPLIB_LIBRARY}")
 
 # Include nlohmann-json
 add_library(nlohmann INTERFACE IMPORTED)
Index: pytorch/caffe2/CMakeLists.txt
===================================================================
--- pytorch.orig/caffe2/CMakeLists.txt
+++ pytorch/caffe2/CMakeLists.txt
@@ -783,6 +783,7 @@ if(NOT FMT_LIBRARY)
     set_property(TARGET fmt PROPERTY IMPORTED_LOCATION "${FMT_LIBRARY}")
 endif()
 target_link_libraries(torch_cpu PRIVATE fmt)
+target_link_libraries(torch_cpu PRIVATE cpp-httplib)
 
 torch_compile_options(torch_cpu)  # see cmake/public/utils.cmake