1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

Funcube dongle support on windows.

This commit is contained in:
Jon Beniston 2022-05-29 21:26:04 +01:00
parent fe7f98c70e
commit 73ad00d0a1
8 changed files with 45 additions and 7 deletions

View File

@ -215,6 +215,7 @@ elseif (WIN32)
set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/include" CACHE INTERNAL "")
set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/libfftw3f-3.lib" CACHE INTERNAL "")
set(FFTW3F_WISDOM "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/fftwf-wisdom.exe" CACHE INTERNAL "")
set(LIBUSB_FOUND ON CACHE INTERNAL "")
set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/include" CACHE INTERNAL "")
set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll/libusb-1.0.lib" CACHE INTERNAL "")
if(VS2019)
@ -273,6 +274,10 @@ elseif (WIN32)
set(ZLIB_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/zlib/include" CACHE INTERNAL "")
set(ZLIB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/zlib/lib/zlibstaticd.lib" CACHE INTERNAL "")
set(HIDAPI_FOUND ON CACHE INTERNAL "")
set(HIDAPI_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/hidapi/include" CACHE INTERNAL "")
set(HIDAPI_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/hidapi/x64/hidapi.lib" CACHE INTERNAL "")
# used on fixup_bundle phase
set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS
"${EXTERNAL_LIBRARY_FOLDER}/fftw-3"
@ -449,7 +454,7 @@ if(ENABLE_USRP)
find_package(UHD)
endif()
if(ENABLE_FUNCUBE AND UNIX AND LIBUSB_FOUND AND HIDAPI_FOUND)
if(ENABLE_FUNCUBE AND LIBUSB_FOUND AND HIDAPI_FOUND)
add_subdirectory(fcdlib)
add_subdirectory(fcdhid)
endif()

View File

@ -26,4 +26,9 @@ target_link_libraries(fcdhid
${ICONV_LIBRARY}
)
set_target_properties(fcdhid PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
if (MSVC)
set_target_properties(fcdhid PROPERTIES INTERPROCEDURAL_OPTIMIZATION false)
endif()
install(TARGETS fcdhid DESTINATION ${INSTALL_LIB_DIR})

View File

@ -10,6 +10,7 @@ set(fcdlib_HEADERS
fcdtraits.h
fcdproplusconst.h
fcdproconst.h
export.h
)
include_directories(
@ -21,4 +22,10 @@ add_library(fcdlib SHARED
target_link_libraries(fcdlib)
set_target_properties(fcdlib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
if (MSVC)
set_target_properties(fcdlib PROPERTIES INTERPROCEDURAL_OPTIMIZATION false)
set_target_properties(fcdlib PROPERTIES DEFINE_SYMBOL "FCDLIB_EXPORTS")
endif()
install(TARGETS fcdlib DESTINATION ${INSTALL_LIB_DIR})

15
fcdlib/export.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef FCDLIB_EXPORT_H_
#define FCDLIB_EXPORT_H_
// cmake's WINDOWS_EXPORT_ALL_SYMBOLS only supports functions, so we need dllexport/import for global data
#ifdef _MSC_VER
#ifdef FCDLIB_EXPORTS
#define FCDLIB_API __declspec(dllexport)
#else
#define FCDLIB_API __declspec(dllimport)
#endif
#else
#define FCDLIB_API
#endif
#endif /* FCDLIB_EXPORT_H_ */

View File

@ -10,6 +10,8 @@
#include <string>
#include "export.h"
typedef enum
{
FCDPRO_TLG_N5_0DB=0,
@ -320,7 +322,7 @@ typedef struct
std::string label;
} fcdpro_if_gain6;
class FCDProConstants
class FCDLIB_API FCDProConstants
{
public:
static const fcdpro_lna_gain lna_gains[];

View File

@ -10,6 +10,8 @@
#include <string>
#include "export.h"
typedef enum
{
FCDPROPLUS_TRF_0_4,
@ -49,7 +51,7 @@ typedef struct
std::string label;
} fcdproplus_if_filter;
class FCDProPlusConstants
class FCDLIB_API FCDProPlusConstants
{
public:
static const fcdproplus_rf_filter rf_filters[];

View File

@ -20,6 +20,8 @@
#include <inttypes.h>
#include "export.h"
typedef enum
{
Pro,
@ -27,7 +29,7 @@ typedef enum
} fcd_type;
template <fcd_type FCDType>
struct fcd_traits
struct FCDLIB_API fcd_traits
{
static const uint16_t vendorId = 0x0;
static const uint16_t productId = 0x0;
@ -45,7 +47,7 @@ struct fcd_traits
};
template<>
struct fcd_traits<Pro>
struct FCDLIB_API fcd_traits<Pro>
{
static const uint16_t vendorId = 0x04D8;
static const uint16_t productId = 0xFB56;
@ -63,7 +65,7 @@ struct fcd_traits<Pro>
};
template<>
struct fcd_traits<ProPlus>
struct FCDLIB_API fcd_traits<ProPlus>
{
static const uint16_t vendorId = 0x04D8;
static const uint16_t productId = 0xFB31;

View File

@ -21,7 +21,7 @@ if(ENABLE_BLADERF AND LIBBLADERF_FOUND)
add_subdirectory(bladerf2input)
endif()
if(ENABLE_FUNCUBE AND UNIX AND LIBUSB_FOUND AND HIDAPI_FOUND)
if(ENABLE_FUNCUBE AND LIBUSB_FOUND AND HIDAPI_FOUND)
add_subdirectory(fcdpro)
add_subdirectory(fcdproplus)
endif()