1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-22 17:45:48 -05:00

Fix and enable sdrbench build on Windows

This commit is contained in:
Kacper Michajłow 2020-11-19 17:40:01 +01:00
parent 305c97fc0e
commit f8dcbaab66
7 changed files with 27 additions and 78 deletions

View File

@ -421,13 +421,7 @@ add_subdirectory(logging)
add_subdirectory(qrtplib)
add_subdirectory(swagger)
add_subdirectory(devices)
# strange symbol dependency
# mainbench.obj : error LNK2001: unresolved external
# symbol "public: static float const decimation_scale<12>::scaleIn" (?scaleIn@?$decimation_scale@$0M@@@2MB)
if(NOT WIN32)
add_subdirectory(sdrbench)
endif()
add_subdirectory(sdrbench)
if (BUILD_GUI)
add_subdirectory(sdrgui)
@ -494,21 +488,19 @@ else()
endif()
############ build sdrangel benchmark ################
if(NOT WIN32)
set(sdrangelbench_SOURCES
appbench/main.cpp
)
set(sdrangelbench_SOURCES
appbench/main.cpp
)
add_executable(sdrangelbench
${sdrangelbench_SOURCES}
)
add_executable(sdrangelbench
${sdrangelbench_SOURCES}
)
target_link_libraries(sdrangelbench
Qt5::Multimedia
sdrbench
logging
)
endif()
target_link_libraries(sdrangelbench
Qt5::Multimedia
sdrbench
logging
)
############ build sdrangel gui ################
if (BUILD_GUI)
set(sdrangel_SOURCES
@ -554,9 +546,7 @@ if (BUILD_SERVER)
endif()
############ install ##################
if(NOT WIN32)
install(TARGETS sdrangelbench DESTINATION ${INSTALL_BIN_DIR})
endif()
install(TARGETS sdrangelbench DESTINATION ${INSTALL_BIN_DIR})
if (BUILD_GUI)
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${INSTALL_BIN_DIR})
endif()

View File

@ -21,20 +21,22 @@
#include <QSysInfo>
#include <QTimer>
#include <signal.h>
#include <unistd.h>
#include <vector>
#include "loggerwithfile.h"
#include "mainbench.h"
#include "dsp/dsptypes.h"
#ifndef _WIN32
#include <signal.h>
#include <unistd.h>
void handler(int sig) {
fprintf(stderr, "quit the application by signal(%d).\n", sig);
QCoreApplication::quit();
}
#ifndef _WIN32
void catchUnixSignals(const std::vector<int>& quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);

View File

@ -99,7 +99,6 @@ set(sdrbase_SOURCES
dsp/channelsamplesource.cpp
dsp/cwkeyer.cpp
dsp/cwkeyersettings.cpp
dsp/decimatorsif.cpp
dsp/decimatorsff.cpp
dsp/decimatorsfi.cpp
dsp/decimatorc.cpp

View File

@ -1,23 +0,0 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "decimatorsif.h"
const float decimation_scale<8>::scaleIn = 1.0/128.0;
const float decimation_scale<12>::scaleIn = 1.0/2048.0;
const float decimation_scale<16>::scaleIn = 1.0/32768.0;

View File

@ -26,31 +26,9 @@
template<uint InputBits>
struct decimation_scale
{
static const float scaleIn;
static constexpr float scaleIn = 1.0f / (1 << (InputBits - 1));
};
template<uint InputBits>
const float decimation_scale<InputBits>::scaleIn = 1.0;
template<>
struct decimation_scale<8>
{
static const float scaleIn;
};
template<>
struct decimation_scale<12>
{
static const float scaleIn;
};
template<>
struct decimation_scale<16>
{
static const float scaleIn;
};
template<typename T, uint InputBits, bool IQOrder>
class DecimatorsIF {
public:

View File

@ -29,6 +29,7 @@
#include "dsp/decimatorsfi.h"
#include "dsp/decimatorsff.h"
#include "parserbench.h"
#include "export.h"
namespace qtwebapp {
class LoggerWithFile;
@ -38,8 +39,8 @@ class MainBench: public QObject {
Q_OBJECT
public:
explicit MainBench(qtwebapp::LoggerWithFile *logger, const ParserBench& parser, QObject *parent = 0);
~MainBench();
SDRBASE_API explicit MainBench(qtwebapp::LoggerWithFile *logger, const ParserBench& parser, QObject *parent = 0);
SDRBASE_API ~MainBench();
public slots:
void run();

View File

@ -22,6 +22,8 @@
#include <QCommandLineParser>
#include <stdint.h>
#include "export.h"
class ParserBench
{
public:
@ -36,10 +38,10 @@ public:
TestAMBE
} TestType;
ParserBench();
~ParserBench();
SDRBASE_API ParserBench();
SDRBASE_API ~ParserBench();
void parse(const QCoreApplication& app);
SDRBASE_API void parse(const QCoreApplication& app);
const QString& getTestStr() const { return m_testStr; }
TestType getTestType() const;