diff options
| author | crueter <crueter@eden-emu.dev> | 2026-02-15 20:51:05 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-02-15 20:51:05 +0100 |
| commit | f4e7fc91ba8d12dada247139a61e9ac1b8195276 (patch) | |
| tree | 65a8cb85c59216c45ce28d078307ea648e1ef0d9 /src | |
| parent | 45c9f9bbb31ed06976bfacbc7bbf8851191ffb84 (diff) | |
[cmake, frontend] Fix update checker and move to self-hosted Git (#3558)
httplib doesn't like when you include the protocol, as it would seem
Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3558
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/scm_rev.cpp.in | 2 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 1 | ||||
| -rw-r--r-- | src/frontend_common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/frontend_common/update_checker.cpp | 8 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index b3d9455853..cc7b092270 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in @@ -20,6 +20,7 @@ #define COMPILER_ID "@CXX_COMPILER@" #define BUILD_AUTO_UPDATE_WEBSITE "@BUILD_AUTO_UPDATE_WEBSITE@" #define BUILD_AUTO_UPDATE_API "@BUILD_AUTO_UPDATE_API@" +#define BUILD_AUTO_UPDATE_API_PATH "@BUILD_AUTO_UPDATE_API_PATH@" #define BUILD_AUTO_UPDATE_REPO "@BUILD_AUTO_UPDATE_REPO@" #define IS_NIGHTLY_BUILD @IS_NIGHTLY_BUILD@ @@ -42,6 +43,7 @@ constexpr const bool g_is_nightly_build = IS_NIGHTLY_BUILD; constexpr const char g_build_auto_update_website[] = BUILD_AUTO_UPDATE_WEBSITE; constexpr const char g_build_auto_update_api[] = BUILD_AUTO_UPDATE_API; +constexpr const char g_build_auto_update_api_path[] = BUILD_AUTO_UPDATE_API_PATH; constexpr const char g_build_auto_update_repo[] = BUILD_AUTO_UPDATE_REPO; } // namespace Common diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 8c4338aaa8..07f941fb93 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h @@ -26,6 +26,7 @@ extern const bool g_is_nightly_build; extern const char g_build_auto_update_website[]; extern const char g_build_auto_update_api[]; +extern const char g_build_auto_update_api_path[]; extern const char g_build_auto_update_repo[]; } // namespace Common diff --git a/src/frontend_common/CMakeLists.txt b/src/frontend_common/CMakeLists.txt index 5c248ea337..82993e45b6 100644 --- a/src/frontend_common/CMakeLists.txt +++ b/src/frontend_common/CMakeLists.txt @@ -24,7 +24,7 @@ if (ENABLE_UPDATE_CHECKER) update_checker.h) if (ENABLE_OPENSSL) - target_compile_definitions(frontend_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) + target_compile_definitions(frontend_common PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT) target_link_libraries(frontend_common PRIVATE OpenSSL::SSL OpenSSL::Crypto) endif() diff --git a/src/frontend_common/update_checker.cpp b/src/frontend_common/update_checker.cpp index c12595185a..6b1fde720c 100644 --- a/src/frontend_common/update_checker.cpp +++ b/src/frontend_common/update_checker.cpp @@ -82,8 +82,8 @@ std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::stri std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease(bool include_prereleases) { const auto update_check_url = std::string{Common::g_build_auto_update_api}; - std::string update_check_path = fmt::format("/repos/{}", - std::string{Common::g_build_auto_update_repo}); + auto update_check_path = fmt::format("{}{}", std::string{Common::g_build_auto_update_api_path}, + std::string{Common::g_build_auto_update_repo}); try { if (include_prereleases) { // This can return either a prerelease or a stable release, // whichever is more recent. @@ -124,14 +124,14 @@ std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease(bool includ return Update{latest_tag, latest_name}; } - } catch (nlohmann::detail::out_of_range &) { + } catch (nlohmann::detail::out_of_range&) { LOG_ERROR(Frontend, "Parsing JSON response from {}{} failed during update check: " "nlohmann::detail::out_of_range", update_check_url, update_check_path); return {}; - } catch (nlohmann::detail::type_error &) { + } catch (nlohmann::detail::type_error&) { LOG_ERROR(Frontend, "Parsing JSON response from {}{} failed during update check: " "nlohmann::detail::type_error", |
