]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/rtlsdr/Compile-with-msvc.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / rtlsdr / Compile-with-msvc.patch
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 2def354..674ff2d 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -66,6 +66,12 @@ endif()
6 ########################################################################
7 # Find build dependencies
8 ########################################################################
9 +if(MSVC)
10 +find_package(pthreads)
11 +find_package(libusb)
12 +include_directories(${PThreads4W_INCLUDE_DIR})
13 +include_directories(${LIBUSB_INCLUDE_DIRS})
14 +else()
15 if(WIN32 AND NOT MINGW)
16 set(THREADS_USE_PTHREADS_WIN32 true)
17 endif()
18 @@ -79,6 +85,7 @@ endif()
19 if(NOT THREADS_FOUND)
20 message(FATAL_ERROR "pthreads(-win32) required to compile rtl-sdr")
21 endif()
22 +endif()
23
24 ########################################################################
25 # Create uninstall target
26 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
27 index 33faee7..fda4612 100644
28 --- a/src/CMakeLists.txt
29 +++ b/src/CMakeLists.txt
30 @@ -20,7 +20,11 @@
31 ########################################################################
32 add_library(rtlsdr SHARED librtlsdr.c
33 tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
34 +if(MSVC)
35 +target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES})
36 +else()
37 target_link_libraries(rtlsdr PkgConfig::LIBUSB)
38 +endif()
39 target_include_directories(rtlsdr PUBLIC
40 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
41 $<INSTALL_INTERFACE:include> # <prefix>/include
42 @@ -36,7 +40,11 @@ generate_export_header(rtlsdr)
43 ########################################################################
44 add_library(rtlsdr_static STATIC librtlsdr.c
45 tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
46 +if(MSVC)
47 +target_link_libraries(rtlsdr_static ${LIBUSB_LIBRARIES})
48 +else()
49 target_link_libraries(rtlsdr_static PkgConfig::LIBUSB)
50 +endif()
51 target_include_directories(rtlsdr_static PUBLIC
52 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
53 $<INSTALL_INTERFACE:include> # <prefix>/include
54 @@ -58,8 +66,8 @@ IF(MSVC)
55 ${CMAKE_CURRENT_SOURCE_DIR}/rtlsdr.rc.in
56 ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc
57 @ONLY)
58 - target_sources(rtlsdr ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
59 - target_sources(rtlsdr_static ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
60 + target_sources(rtlsdr PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
61 + target_sources(rtlsdr_static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
62 ENDIF(MSVC)
63
64 ########################################################################
65 @@ -77,6 +85,11 @@ add_library(libgetopt_static STATIC
66 target_link_libraries(convenience_static
67 rtlsdr
68 )
69 +if(MSVC)
70 +target_link_libraries(convenience_static
71 + ${PThreads4W_LIBRARY}
72 +)
73 +endif()
74 endif()
75
76 ########################################################################
77 diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
78 index 562198f..b4bfa51 100644
79 --- a/src/rtl_tcp.c
80 +++ b/src/rtl_tcp.c
81 @@ -35,6 +35,7 @@
82 #include <fcntl.h>
83 #else
84 #include <winsock2.h>
85 +#include <ws2tcpip.h>
86 #include "getopt/getopt.h"
87 #endif
88