diff --git a/source/main/gui/panels/GUI_RepositorySelector.h b/source/main/gui/panels/GUI_RepositorySelector.h index f6dfc210e8..28dbf79129 100644 --- a/source/main/gui/panels/GUI_RepositorySelector.h +++ b/source/main/gui/panels/GUI_RepositorySelector.h @@ -33,7 +33,9 @@ #include #include #include -#include +#ifdef USE_CURL +# include +#endif //USE_CURL namespace RoR { namespace GUI { @@ -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 diff --git a/source/main/scripting/GameScript.cpp b/source/main/scripting/GameScript.cpp index 98b54bba1f..a4110fd7ef 100644 --- a/source/main/scripting/GameScript.cpp +++ b/source/main/scripting/GameScript.cpp @@ -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"); @@ -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; }