1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
From: "A. Maitland Bottoms" <bottoms@debian.org>
Subject: optional sio client
Debian does not yet have socket,io-sioclient-cpp
packaged, so build without FreeDVReporter feature.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -393,6 +393,8 @@
# sioclient library
+option(USE_SIOCLIENT "Report using sioclient." ON)
+if(USE_SIOCLIENT)
message(STATUS "Looking for sioclient...")
find_path(SIOCLIENT_INCLUDE_DIR sio_client.h)
find_library(SIOCLIENT_LIBRARY sioclient)
@@ -406,7 +408,8 @@
message(STATUS "Using static sioclient build")
include(cmake/BuildSocketIo.cmake)
endif(SIOCLIENT_LIBRARY AND SIOCLIENT_INCLUDE_DIR)
-
+add_definitions(-DUSE_SIOCLIENT)
+endif(USE_SIOCLIENT)
#
# Samplerate Library
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -77,6 +77,10 @@
add_executable(freedv WIN32 ${FREEDV_SOURCES} ${RES_FILES})
endif(APPLE)
+if(USE_SIOLOB)
+ target_compile_definitions(FreeDV USE_SIOCLIENT=1)
+endif(USE_SIOLOB)
+
# Link imported or build tree targets.
if(APPLE)
target_link_libraries(FreeDV fdv_audio fdv_audio_pipeline fdv_reporting fdv_sox lpcnetfreedv codec2)
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -37,7 +37,9 @@
#include "codec2_fdmdv.h"
#include "pipeline/TxRxThread.h"
#include "reporting/pskreporter.h"
+#ifdef USE_SIOCLIENT
#include "reporting/FreeDVReporter.h"
+#endif
#define wxUSE_FILEDLG 1
#define wxUSE_LIBPNG 1
@@ -2087,9 +2089,10 @@
assert(pskReporter != nullptr);
wxGetApp().m_reporters.push_back(pskReporter);
}
-
+
if (wxGetApp().m_freedvReporterEnabled && wxGetApp().m_freedvReporterHostname.ToStdString() != "")
{
+#ifdef USE_SIOCLIENT
auto freedvReporter =
new FreeDVReporter(
wxGetApp().m_freedvReporterHostname.ToStdString(),
@@ -2098,6 +2101,7 @@
std::string("FreeDV ") + FREEDV_VERSION);
assert(freedvReporter);
wxGetApp().m_reporters.push_back(freedvReporter);
+#endif
}
else if (wxGetApp().m_freedvReporterEnabled)
{
--- a/src/reporting/CMakeLists.txt
+++ b/src/reporting/CMakeLists.txt
@@ -1,10 +1,17 @@
+message(STATUS "Reporting....")
+if(SIOCLIENT_ADD_DEPENDENCY)
add_library(fdv_reporting STATIC
pskreporter.cpp
pskreporter.h
FreeDVReporter.cpp
FreeDVReporter.h
)
-
-if(SIOCLIENT_ADD_DEPENDENCY)
add_dependencies(fdv_reporting sioclient)
+message(STATUS "Reporting via pskreporter and FreeDVReporter.")
+else(SIOCLIENT_ADD_DEPENDENCY)
+add_library(fdv_reporting STATIC
+ pskreporter.cpp
+ pskreporter.h
+)
+message(STATUS "Reporting via pskreporter only.")
endif(SIOCLIENT_ADD_DEPENDENCY)
|