Merge pull request #1262 from srcejon/mac_package

Funcube dongle support on windows
pull/1265/head
Edouard Griffiths 2022-05-30 16:14:06 +02:00 zatwierdzone przez GitHub
commit 05122dd084
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
9 zmienionych plików z 46 dodań i 8 usunięć

Wyświetl plik

@ -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()

2
external/windows vendored

@ -1 +1 @@
Subproject commit 2d498134136cbf9094b1fa9e9c49b99874bf3c3c
Subproject commit 19a3329f39725a33e8d488ce620d0a162c3ce0a8

Wyświetl plik

@ -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})

Wyświetl plik

@ -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 100644
Wyświetl plik

@ -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_ */

Wyświetl plik

@ -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[];

Wyświetl plik

@ -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[];

Wyświetl plik

@ -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;

Wyświetl plik

@ -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()