Skip to content

Commit

Permalink
Fixed build without CURL
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp authored and Petr Ohlídal committed Mar 14, 2023
1 parent 722989f commit d87a1e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/main/gui/panels/GUI_RepositorySelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#include <memory>
#include <thread>
#include <vector>
#include <curl/curl.h>
#ifdef USE_CURL
# include <curl/curl.h>
#endif //USE_CURL

namespace RoR {
namespace GUI {
Expand Down Expand Up @@ -127,7 +129,9 @@ class RepositorySelector:
ResourceItem m_selected_item;
Ogre::uint16 m_ogre_workqueue_channel = 0;
Ogre::TexturePtr m_fallback_thumbnail;
#ifdef USE_CURL
CURL *curl_th = curl_easy_init(); // One connection for fetching thumbnails using connection reuse
#endif
};

}// namespace GUI
Expand Down
5 changes: 5 additions & 0 deletions source/main/scripting/GameScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ int GameScript::useOnlineAPI(const String& apiquery, const AngelScript::CScriptD
j_doc.Accept(writer);
std::string json = buffer.GetString();

#if USE_CURL
RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE,
_L("using Online API..."), "information.png");

Expand All @@ -849,6 +850,10 @@ int GameScript::useOnlineAPI(const String& apiquery, const AngelScript::CScriptD
curl_slist_free_all(slist);
slist = NULL;
}).detach();
#else // USE_CURL
RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_WARNING,
_L("Cannot use Online API in this build (CURL not available)"));
#endif // USE_CURL

return 0;
}
Expand Down

0 comments on commit d87a1e4

Please sign in to comment.