From 9a737a06226e44dd295231b500f9418d3d5104fc Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 16 Mar 2018 15:47:23 +0200 Subject: [PATCH] Added ability to turn off sending of stats in CMake configuration --- src/CMakeLists.txt | 6 ++++++ src/d_stats.cpp | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 58ca6a9ba9..e75798a549 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -639,6 +639,12 @@ elseif( FLUIDSYNTH_FOUND ) add_definitions( -DHAVE_FLUIDSYNTH ) endif() +option( SEND_ANON_STATS "Enable sending of anonymous hardware statistics" ON ) + +if( NOT SEND_ANON_STATS ) + add_definitions( -DNO_SEND_STATS ) +endif() + # Project files should be aware of the header files. We can GLOB these since # there's generally a new cpp for every header so this file will get changed if( WIN32 ) diff --git a/src/d_stats.cpp b/src/d_stats.cpp index 5886d4cef5..9ea3e80b57 100644 --- a/src/d_stats.cpp +++ b/src/d_stats.cpp @@ -1,3 +1,12 @@ + +#ifdef NO_SEND_STATS + +void D_DoAnonStats() +{ +} + +#else // !NO_SEND_STATS + #if defined(_WIN32) #define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN @@ -276,3 +285,5 @@ void D_DoAnonStats() std::thread t1(D_DoHTTPRequest, requeststring); t1.detach(); } + +#endif // NO_SEND_STATS