diff options
| -rw-r--r-- | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 22 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 10 |
5 files changed, 32 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4668d4bea..ad73cf495 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -11,6 +11,8 @@ option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF) | |||
| 11 | option(ENABLE_QT "Enable the Qt frontend" ON) | 11 | option(ENABLE_QT "Enable the Qt frontend" ON) |
| 12 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) | 12 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) |
| 13 | 13 | ||
| 14 | option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) | ||
| 15 | |||
| 14 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) | 16 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) |
| 15 | message(STATUS "Copying pre-commit hook") | 17 | message(STATUS "Copying pre-commit hook") |
| 16 | file(COPY hooks/pre-commit | 18 | file(COPY hooks/pre-commit |
| @@ -223,6 +225,9 @@ if (ENABLE_QT) | |||
| 223 | find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT}) | 225 | find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT}) |
| 224 | endif() | 226 | endif() |
| 225 | 227 | ||
| 228 | if (ENABLE_WEB_SERVICE) | ||
| 229 | add_definitions(-DENABLE_WEB_SERVICE) | ||
| 230 | endif() | ||
| 226 | 231 | ||
| 227 | # Platform-specific library requirements | 232 | # Platform-specific library requirements |
| 228 | # ====================================== | 233 | # ====================================== |
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 11c5d8e7d..ccc7f13b6 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -4,12 +4,6 @@ | |||
| 4 | add_library(catch-single-include INTERFACE) | 4 | add_library(catch-single-include INTERFACE) |
| 5 | target_include_directories(catch-single-include INTERFACE catch/single_include) | 5 | target_include_directories(catch-single-include INTERFACE catch/single_include) |
| 6 | 6 | ||
| 7 | # CPR | ||
| 8 | option(BUILD_TESTING OFF) | ||
| 9 | option(BUILD_CPR_TESTS OFF) | ||
| 10 | add_subdirectory(cpr) | ||
| 11 | target_include_directories(cpr INTERFACE ./cpr/include) | ||
| 12 | |||
| 13 | # Crypto++ | 7 | # Crypto++ |
| 14 | add_subdirectory(cryptopp) | 8 | add_subdirectory(cryptopp) |
| 15 | 9 | ||
| @@ -34,10 +28,6 @@ add_subdirectory(glad) | |||
| 34 | # inih | 28 | # inih |
| 35 | add_subdirectory(inih) | 29 | add_subdirectory(inih) |
| 36 | 30 | ||
| 37 | # JSON | ||
| 38 | add_library(json-headers INTERFACE) | ||
| 39 | target_include_directories(json-headers INTERFACE ./json/src) | ||
| 40 | |||
| 41 | # MicroProfile | 31 | # MicroProfile |
| 42 | add_library(microprofile INTERFACE) | 32 | add_library(microprofile INTERFACE) |
| 43 | target_include_directories(microprofile INTERFACE ./microprofile) | 33 | target_include_directories(microprofile INTERFACE ./microprofile) |
| @@ -62,3 +52,15 @@ endif() | |||
| 62 | # ENet | 52 | # ENet |
| 63 | add_subdirectory(enet) | 53 | add_subdirectory(enet) |
| 64 | target_include_directories(enet INTERFACE ./enet/include) | 54 | target_include_directories(enet INTERFACE ./enet/include) |
| 55 | |||
| 56 | if (ENABLE_WEB_SERVICE) | ||
| 57 | # CPR | ||
| 58 | option(BUILD_TESTING OFF) | ||
| 59 | option(BUILD_CPR_TESTS OFF) | ||
| 60 | add_subdirectory(cpr) | ||
| 61 | target_include_directories(cpr INTERFACE ./cpr/include) | ||
| 62 | |||
| 63 | # JSON | ||
| 64 | add_library(json-headers INTERFACE) | ||
| 65 | target_include_directories(json-headers INTERFACE ./json/src) | ||
| 66 | endif() | ||
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() | |||
| 14 | if (ENABLE_QT) | 14 | if (ENABLE_QT) |
| 15 | add_subdirectory(citra_qt) | 15 | add_subdirectory(citra_qt) |
| 16 | endif() | 16 | endif() |
| 17 | add_subdirectory(web_service) | 17 | if (ENABLE_WEB_SERVICE) |
| 18 | add_subdirectory(web_service) | ||
| 19 | 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 | |||
| 386 | 386 | ||
| 387 | create_directory_groups(${SRCS} ${HEADERS}) | 387 | create_directory_groups(${SRCS} ${HEADERS}) |
| 388 | add_library(core STATIC ${SRCS} ${HEADERS}) | 388 | add_library(core STATIC ${SRCS} ${HEADERS}) |
| 389 | target_link_libraries(core PUBLIC common PRIVATE audio_core video_core web_service) | 389 | target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) |
| 390 | target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic fmt) | 390 | target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic fmt) |
| 391 | if (ENABLE_WEB_SERVICE) | ||
| 392 | target_link_libraries(core PUBLIC json-headers web_service) | ||
| 393 | 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 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/scm_rev.h" | 7 | #include "common/scm_rev.h" |
| 8 | #include "core/telemetry_session.h" | 8 | #include "core/telemetry_session.h" |
| 9 | #include "web_services/telemetry_json.h" | 9 | |
| 10 | #ifdef ENABLE_WEB_SERVICE | ||
| 11 | #include "web_service/telemetry_json.h" | ||
| 12 | #endif | ||
| 10 | 13 | ||
| 11 | namespace Core { | 14 | namespace Core { |
| 12 | 15 | ||
| 13 | TelemetrySession::TelemetrySession() { | 16 | TelemetrySession::TelemetrySession() { |
| 17 | #ifdef ENABLE_WEB_SERVICE | ||
| 14 | backend = std::make_unique<WebService::TelemetryJson>(); | 18 | backend = std::make_unique<WebService::TelemetryJson>(); |
| 15 | 19 | #else | |
| 20 | backend = std::make_unique<Telemetry::NullVisitor>(); | ||
| 21 | #endif | ||
| 16 | // Log one-time session start information | 22 | // Log one-time session start information |
| 17 | const auto duration{std::chrono::steady_clock::now().time_since_epoch()}; | 23 | const auto duration{std::chrono::steady_clock::now().time_since_epoch()}; |
| 18 | const auto start_time{std::chrono::duration_cast<std::chrono::microseconds>(duration).count()}; | 24 | const auto start_time{std::chrono::duration_cast<std::chrono::microseconds>(duration).count()}; |