HTTPDownloader: Move to common

This commit is contained in:
Connor McLaughlin 2022-03-26 23:05:02 +10:00
parent cb51ab7197
commit d5128a5ea9
15 changed files with 54 additions and 51 deletions

View File

@ -246,6 +246,27 @@ if(APPLE)
)
endif()
if(ENABLE_CHEEVOS)
target_sources(common PRIVATE
http_downloader.cpp
http_downloader.h
)
if(WIN32)
target_sources(common PRIVATE
http_downloader_winhttp.cpp
http_downloader_winhttp.h
)
elseif(NOT ANDROID)
target_sources(common PRIVATE
http_downloader_curl.cpp
http_downloader_curl.h
)
target_link_libraries(common PRIVATE
CURL::libcurl
)
endif()
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# We need -lrt for shm_unlink
target_link_libraries(common PRIVATE rt)

View File

@ -40,6 +40,13 @@
<ClInclude Include="gl\texture.h" />
<ClInclude Include="hash_combine.h" />
<ClInclude Include="heap_array.h" />
<ClInclude Include="http_downloader.h" />
<ClInclude Include="http_downloader_uwp.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'!='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="http_downloader_winhttp.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="image.h" />
<ClInclude Include="iso_reader.h" />
<ClInclude Include="jit_code_buffer.h" />
@ -125,6 +132,13 @@
<ClCompile Include="gl\shader_cache.cpp" />
<ClCompile Include="gl\stream_buffer.cpp" />
<ClCompile Include="gl\texture.cpp" />
<ClCompile Include="http_downloader.cpp" />
<ClCompile Include="http_downloader_uwp.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'!='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="http_downloader_winhttp.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="image.cpp" />
<ClCompile Include="iso_reader.cpp" />
<ClCompile Include="jit_code_buffer.cpp" />

View File

@ -134,6 +134,9 @@
<ClInclude Include="d3d12\shader_cache.h">
<Filter>d3d12</Filter>
</ClInclude>
<ClInclude Include="http_downloader_uwp.h" />
<ClInclude Include="http_downloader_winhttp.h" />
<ClInclude Include="http_downloader.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="jit_code_buffer.cpp" />
@ -264,6 +267,9 @@
<Filter>d3d12</Filter>
</ClCompile>
<ClCompile Include="cd_image_device.cpp" />
<ClCompile Include="http_downloader_winhttp.cpp" />
<ClCompile Include="http_downloader.cpp" />
<ClCompile Include="http_downloader_uwp.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="bitfield.natvis" />

View File

@ -1,7 +1,7 @@
#include "http_downloader.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/timer.h"
#include "assert.h"
#include "log.h"
#include "timer.h"
Log_SetChannel(HTTPDownloader);
static constexpr float DEFAULT_TIMEOUT_IN_SECONDS = 30;

View File

@ -1,8 +1,8 @@
#include "http_downloader_uwp.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/string_util.h"
#include "common/timer.h"
#include "assert.h"
#include "log.h"
#include "string_util.h"
#include "timer.h"
#include <algorithm>
Log_SetChannel(HTTPDownloaderWinHttp);

View File

@ -1,4 +1,5 @@
#pragma once
#pragma once
#include "http_downloader.h"
#include "common/windows_headers.h"

View File

@ -1,8 +1,8 @@
#include "http_downloader_winhttp.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/string_util.h"
#include "common/timer.h"
#include "assert.h"
#include "log.h"
#include "string_util.h"
#include "timer.h"
#include <VersionHelpers.h>
#include <algorithm>
Log_SetChannel(HTTPDownloaderWinHttp);

View File

@ -113,25 +113,6 @@ if(ENABLE_DISCORD_PRESENCE)
endif()
if(ENABLE_CHEEVOS)
target_sources(frontend-common PRIVATE
http_downloader.cpp
http_downloader.h
)
if(WIN32)
target_sources(frontend-common PRIVATE
http_downloader_winhttp.cpp
http_downloader_winhttp.h
)
elseif(NOT ANDROID)
target_sources(frontend-common PRIVATE
http_downloader_curl.cpp
http_downloader_curl.h
)
target_link_libraries(frontend-common PRIVATE
CURL::libcurl
)
endif()
target_sources(frontend-common PRIVATE
cheevos.cpp
cheevos.h

View File

@ -1,6 +1,7 @@
#include "cheevos.h"
#include "common/cd_image.h"
#include "common/file_system.h"
#include "common/http_downloader.h"
#include "common/log.h"
#include "common/md5_digest.h"
#include "common/platform.h"
@ -13,7 +14,6 @@
#include "core/host_display.h"
#include "core/system.h"
#include "fullscreen_ui.h"
#include "http_downloader.h"
#include "imgui_fullscreen.h"
#include "rapidjson/document.h"
#include "rc_url.h"

View File

@ -17,13 +17,6 @@
<ClCompile Include="d3d12_host_display.cpp" />
<ClCompile Include="game_list.cpp" />
<ClCompile Include="game_settings.cpp" />
<ClCompile Include="http_downloader.cpp" />
<ClCompile Include="http_downloader_uwp.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'!='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="http_downloader_winhttp.cpp">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="icon.cpp" />
<ClCompile Include="imgui_fullscreen.cpp" />
<ClCompile Include="imgui_impl_dx11.cpp" />
@ -69,13 +62,6 @@
<ClInclude Include="d3d12_host_display.h" />
<ClInclude Include="game_list.h" />
<ClInclude Include="game_settings.h" />
<ClInclude Include="http_downloader.h" />
<ClInclude Include="http_downloader_uwp.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'!='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="http_downloader_winhttp.h">
<ExcludedFromBuild Condition="'$(BuildingForUWP)'=='true'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="icon.h" />
<ClInclude Include="imgui_fullscreen.h" />
<ClInclude Include="imgui_impl_dx11.h" />

View File

@ -28,15 +28,12 @@
<ClCompile Include="fullscreen_ui.cpp" />
<ClCompile Include="fullscreen_ui_progress_callback.cpp" />
<ClCompile Include="cheevos.cpp" />
<ClCompile Include="http_downloader.cpp" />
<ClCompile Include="http_downloader_winhttp.cpp" />
<ClCompile Include="input_overlay_ui.cpp" />
<ClCompile Include="game_database.cpp" />
<ClCompile Include="inhibit_screensaver.cpp" />
<ClCompile Include="xaudio2_audio_stream.cpp" />
<ClCompile Include="d3d12_host_display.cpp" />
<ClCompile Include="imgui_impl_dx12.cpp" />
<ClCompile Include="http_downloader_uwp.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="icon.h" />
@ -66,15 +63,12 @@
<ClInclude Include="fullscreen_ui.h" />
<ClInclude Include="fullscreen_ui_progress_callback.h" />
<ClInclude Include="cheevos.h" />
<ClInclude Include="http_downloader.h" />
<ClInclude Include="http_downloader_winhttp.h" />
<ClInclude Include="input_overlay_ui.h" />
<ClInclude Include="game_database.h" />
<ClInclude Include="inhibit_screensaver.h" />
<ClInclude Include="xaudio2_audio_stream.h" />
<ClInclude Include="d3d12_host_display.h" />
<ClInclude Include="imgui_impl_dx12.h" />
<ClInclude Include="http_downloader_uwp.h" />
</ItemGroup>
<ItemGroup>
<None Include="font_roboto_regular.inl" />