diff --git a/CMakeLists.txt b/CMakeLists.txt index 800523454..9ca27aa96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/appbench/main.cpp b/appbench/main.cpp index 0c91a875c..be8005a0d 100644 --- a/appbench/main.cpp +++ b/appbench/main.cpp @@ -21,20 +21,22 @@ #include #include -#include -#include #include #include "loggerwithfile.h" #include "mainbench.h" #include "dsp/dsptypes.h" +#ifndef _WIN32 + +#include +#include + void handler(int sig) { fprintf(stderr, "quit the application by signal(%d).\n", sig); QCoreApplication::quit(); } -#ifndef _WIN32 void catchUnixSignals(const std::vector& quitSignals) { sigset_t blocking_mask; sigemptyset(&blocking_mask); diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index 9e3fb0353..93fe2a50a 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -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 diff --git a/sdrbase/dsp/decimatorsif.cpp b/sdrbase/dsp/decimatorsif.cpp deleted file mode 100644 index 5a443642f..000000000 --- a/sdrbase/dsp/decimatorsif.cpp +++ /dev/null @@ -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 . // -/////////////////////////////////////////////////////////////////////////////////// - -#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; - diff --git a/sdrbase/dsp/decimatorsif.h b/sdrbase/dsp/decimatorsif.h index 90a7975bf..24ab35d56 100644 --- a/sdrbase/dsp/decimatorsif.h +++ b/sdrbase/dsp/decimatorsif.h @@ -26,31 +26,9 @@ template struct decimation_scale { - static const float scaleIn; + static constexpr float scaleIn = 1.0f / (1 << (InputBits - 1)); }; -template -const float decimation_scale::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 class DecimatorsIF { public: diff --git a/sdrbench/mainbench.h b/sdrbench/mainbench.h index c92f603f1..20510a39e 100644 --- a/sdrbench/mainbench.h +++ b/sdrbench/mainbench.h @@ -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(); diff --git a/sdrbench/parserbench.h b/sdrbench/parserbench.h index 013578382..f9ae7000f 100644 --- a/sdrbench/parserbench.h +++ b/sdrbench/parserbench.h @@ -22,6 +22,8 @@ #include #include +#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;