From 33b012e86b846bbba1a42193cbaf34fa16b8fb93 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 9 Jul 2017 17:52:18 -0400 Subject: web_service: Add CMake flag to enable. --- src/CMakeLists.txt | 4 +++- src/core/CMakeLists.txt | 5 ++++- src/core/telemetry_session.cpp | 10 ++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f855a5195..e11940f59 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,4 +14,6 @@ endif() if (ENABLE_QT) add_subdirectory(citra_qt) endif() -add_subdirectory(web_service) +if (ENABLE_WEB_SERVICE) + add_subdirectory(web_service) +endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 72233877b..b80efe192 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -386,5 +386,8 @@ set(HEADERS create_directory_groups(${SRCS} ${HEADERS}) add_library(core STATIC ${SRCS} ${HEADERS}) -target_link_libraries(core PUBLIC common PRIVATE audio_core video_core web_service) +target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic fmt) +if (ENABLE_WEB_SERVICE) + target_link_libraries(core PUBLIC json-headers web_service) +endif() diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 1ba0a698d..70eff4340 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -6,13 +6,19 @@ #include "common/scm_rev.h" #include "core/telemetry_session.h" -#include "web_services/telemetry_json.h" + +#ifdef ENABLE_WEB_SERVICE +#include "web_service/telemetry_json.h" +#endif namespace Core { TelemetrySession::TelemetrySession() { +#ifdef ENABLE_WEB_SERVICE backend = std::make_unique(); - +#else + backend = std::make_unique(); +#endif // Log one-time session start information const auto duration{std::chrono::steady_clock::now().time_since_epoch()}; const auto start_time{std::chrono::duration_cast(duration).count()}; -- cgit v1.2.3