Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

Commit 5cec665

Browse files
authored
Merge pull request keenerd#13 from librtlsdr/DRPCWIN
Disable RPC for Windows Builds
2 parents df4a682 + 7228e75 commit 5cec665

File tree

3 files changed

+98
-10
lines changed

3 files changed

+98
-10
lines changed

include/rtl-sdr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
extern "C" {
2525
#endif
2626

27+
#ifndef WIN32
28+
#define _ENABLE_RPC
29+
#endif
30+
31+
2732
#include <stdint.h>
2833
#include <rtl-sdr_export.h>
2934
#include <rtl_tcp.h>

src/CMakeLists.txt

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ MACRO(RTLSDR_APPEND_SRCS)
2121
LIST(APPEND rtlsdr_srcs ${ARGV})
2222
ENDMACRO(RTLSDR_APPEND_SRCS)
2323

24+
if(NOT WIN32)
2425
RTLSDR_APPEND_SRCS(
2526
librtlsdr.c
2627
tuner_e4k.c
@@ -31,6 +32,16 @@ RTLSDR_APPEND_SRCS(
3132
rtlsdr_rpc.c
3233
rtlsdr_rpc_msg.c
3334
)
35+
else()
36+
RTLSDR_APPEND_SRCS(
37+
librtlsdr.c
38+
tuner_e4k.c
39+
tuner_fc0012.c
40+
tuner_fc0013.c
41+
tuner_fc2580.c
42+
tuner_r82xx.c
43+
)
44+
endif()
3445

3546
########################################################################
3647
# Set up Windows DLL resource files
@@ -94,8 +105,12 @@ add_executable(rtl_ir rtl_ir.c)
94105
add_executable(rtl_eeprom rtl_eeprom.c)
95106
add_executable(rtl_adsb rtl_adsb.c)
96107
add_executable(rtl_power rtl_power.c)
97-
add_executable(rtl_rpcd rtl_rpcd.c rtlsdr_rpc_msg.c)
98-
set(INSTALL_TARGETS rtlsdr_shared rtlsdr_static rtl_sdr rtl_tcp rtl_test rtl_fm rtl_ir rtl_eeprom rtl_adsb rtl_power rtl_rpcd)
108+
if (NOT WIN32)
109+
add_executable(rtl_rpcd rtl_rpcd.c rtlsdr_rpc_msg.c)
110+
set(INSTALL_TARGETS rtlsdr_shared rtlsdr_static rtl_sdr rtl_tcp rtl_test rtl_fm rtl_ir rtl_eeprom rtl_adsb rtl_power rtl_rpcd)
111+
else()
112+
set(INSTALL_TARGETS rtlsdr_shared rtlsdr_static rtl_sdr rtl_tcp rtl_test rtl_fm rtl_ir rtl_eeprom rtl_adsb rtl_power)
113+
endif()
99114

100115
target_link_libraries(rtl_sdr rtlsdr_shared convenience_static
101116
${LIBUSB_LIBRARIES}
@@ -129,10 +144,13 @@ target_link_libraries(rtl_power rtlsdr_shared convenience_static
129144
${LIBUSB_LIBRARIES}
130145
${CMAKE_THREAD_LIBS_INIT}
131146
)
147+
if(NOT WIN32)
132148
target_link_libraries(rtl_rpcd rtlsdr_shared convenience_static
133149
${LIBUSB_LIBRARIES}
134150
${CMAKE_THREAD_LIBS_INIT}
135151
)
152+
endif()
153+
136154
if(UNIX)
137155
target_link_libraries(rtl_fm m)
138156
target_link_libraries(rtl_ir m)
@@ -154,7 +172,7 @@ target_link_libraries(rtl_ir libgetopt_static)
154172
target_link_libraries(rtl_eeprom libgetopt_static)
155173
target_link_libraries(rtl_adsb libgetopt_static)
156174
target_link_libraries(rtl_power libgetopt_static)
157-
target_link_libraries(rtl_rpcd ws2_32 libgetopt_static)
175+
#target_link_libraries(rtl_rpcd ws2_32 libgetopt_static)
158176
set_property(TARGET rtl_sdr APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
159177
set_property(TARGET rtl_tcp APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
160178
set_property(TARGET rtl_test APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
@@ -163,7 +181,7 @@ set_property(TARGET rtl_ir APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
163181
set_property(TARGET rtl_eeprom APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
164182
set_property(TARGET rtl_adsb APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
165183
set_property(TARGET rtl_power APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
166-
set_property(TARGET rtl_rpcd APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
184+
#set_property(TARGET rtl_rpcd APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
167185
endif()
168186
########################################################################
169187
# Install built library files & utilities

0 commit comments

Comments
 (0)