mirror of https://github.com/drowe67/librtlsdr.git
commit
769da46da8
|
@ -57,6 +57,22 @@ if(CMAKE_COMPILER_IS_GNUCC AND NOT WIN32)
|
||||||
add_definitions(-fvisibility=hidden)
|
add_definitions(-fvisibility=hidden)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
OPTION(RTL_STATIC_BUILD "Build rtl-tools static (except RTLSDR.DLL) on MinGW/Win32" ON)
|
||||||
|
if(RTL_STATIC_BUILD)
|
||||||
|
if (WIN32)
|
||||||
|
if(MINGW)
|
||||||
|
# Special MINGW stuff here
|
||||||
|
# see https://cmake.org/pipermail/cmake/2012-September/051970.html
|
||||||
|
# see http://stackoverflow.com/questions/13768515/how-to-do-static-linking-of-libwinpthread-1-dll-in-mingw
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# Bug Fix
|
# Bug Fix
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
|
@ -682,7 +682,7 @@ int main(int argc, char **argv)
|
||||||
bind(s,(struct sockaddr *)&local,sizeof(local));
|
bind(s,(struct sockaddr *)&local,sizeof(local));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
ioctlsocket(listensocket, FIONBIO, &blockmode);
|
ioctlsocket(s, FIONBIO, &blockmode);
|
||||||
#else
|
#else
|
||||||
r = fcntl(s, F_GETFL, 0);
|
r = fcntl(s, F_GETFL, 0);
|
||||||
r = fcntl(s, F_SETFL, r | O_NONBLOCK);
|
r = fcntl(s, F_SETFL, r | O_NONBLOCK);
|
||||||
|
|
|
@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
# edit this path
|
# edit this path
|
||||||
SET( LIBUSBBASE C:/src/_foreign/libusb-1.0.20 )
|
SET( LIBUSBBASE C:/src/_foreign/libusb-1.0.20 )
|
||||||
|
|
||||||
OPTION(RTL_FULL_STATIC_BUILD "Build rtl-tools fully static." OFF)
|
OPTION(RTL_FULL_STATIC_BUILD "Build rtl-tools fully static." ON)
|
||||||
|
|
||||||
if(RTL_FULL_STATIC_BUILD)
|
if(RTL_FULL_STATIC_BUILD)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -86,6 +86,9 @@ target_link_libraries( rtl_tcp ${LIBUSB} ${SOCKLIBS} )
|
||||||
add_executable( rtl_udp ../src/rtl_udp.c ${RTLLIBFILES} )
|
add_executable( rtl_udp ../src/rtl_udp.c ${RTLLIBFILES} )
|
||||||
target_link_libraries( rtl_udp ${LIBUSB} ${SOCKLIBS} )
|
target_link_libraries( rtl_udp ${LIBUSB} ${SOCKLIBS} )
|
||||||
|
|
||||||
|
add_executable( rtl_sdr ../src/rtl_sdr.c ${RTLLIBFILES} )
|
||||||
|
target_link_libraries( rtl_sdr ${LIBUSB} )
|
||||||
|
|
||||||
add_executable( rtl_adsb ../src/rtl_adsb.c ${RTLLIBFILES} )
|
add_executable( rtl_adsb ../src/rtl_adsb.c ${RTLLIBFILES} )
|
||||||
target_link_libraries( rtl_adsb ${LIBUSB} )
|
target_link_libraries( rtl_adsb ${LIBUSB} )
|
||||||
|
|
||||||
|
@ -94,3 +97,13 @@ target_link_libraries( rtl_power ${LIBUSB} )
|
||||||
|
|
||||||
add_executable( rtl_ir ../src/rtl_ir.c ${RTLLIBFILES} )
|
add_executable( rtl_ir ../src/rtl_ir.c ${RTLLIBFILES} )
|
||||||
target_link_libraries( rtl_ir ${LIBUSB} )
|
target_link_libraries( rtl_ir ${LIBUSB} )
|
||||||
|
|
||||||
|
add_executable( rtl_eeprom ../src/rtl_eeprom.c ${RTLLIBFILES} )
|
||||||
|
target_link_libraries( rtl_eeprom ${LIBUSB} )
|
||||||
|
|
||||||
|
if (NOT WIN32)
|
||||||
|
# errors at compilation with MinGW, e.g. missing include sys/select.h
|
||||||
|
add_executable( rtl_rpcd ../src/rtl_rpcd.c ../src/rtlsdr_rpc_msg.c ${RTLLIBFILES} )
|
||||||
|
target_link_libraries( rtl_rpcd ${LIBUSB} )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -29,3 +29,15 @@ the resulting executables have no other dependencies than libwinpthread-1.dll
|
||||||
from the MINGW system at C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\
|
from the MINGW system at C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\
|
||||||
or C:\Qt\Qt5.5.1\5.5\mingw492_32\bin
|
or C:\Qt\Qt5.5.1\5.5\mingw492_32\bin
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
opening main CMakeLists.txt in root (above win32-qtcreator) with above QT 5.5/qtcreator
|
||||||
|
|
||||||
|
set RTL_STATIC_BUILD = ON
|
||||||
|
set LIBUSB_FOUND = TRUE
|
||||||
|
set LIBUSB_INCLUDE_DIR = C:/src/_foreign/libusb-1.0.20/include/libusb-1.0
|
||||||
|
set LIBUSB_LIBRARIES = C:/src/_foreign/libusb-1.0.20/MinGW32/static/libusb-1.0.a
|
||||||
|
set THREADS_PTHREADS_INCLUDE_DIR = C:/Qt/Qt5.6.1/Tools/mingw492_32/i686-w64-mingw32/include
|
||||||
|
set THREADS_PTHREADS_WIN32_LIBRARY = C:/Qt/Qt5.6.1/Tools/mingw492_32/i686-w64-mingw32/lib/libwinpthread.a
|
||||||
|
|
||||||
|
the resulting executables have no other dependencies, except the freshly built librtlsdr.dll
|
||||||
|
|
Loading…
Reference in New Issue