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