mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
HTTPDownloader: Move to common
This commit is contained in:
parent
cb51ab7197
commit
d5128a5ea9
|
@ -246,6 +246,27 @@ if(APPLE)
|
||||||
)
|
)
|
||||||
endif()
|
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")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
# We need -lrt for shm_unlink
|
# We need -lrt for shm_unlink
|
||||||
target_link_libraries(common PRIVATE rt)
|
target_link_libraries(common PRIVATE rt)
|
||||||
|
|
|
@ -40,6 +40,13 @@
|
||||||
<ClInclude Include="gl\texture.h" />
|
<ClInclude Include="gl\texture.h" />
|
||||||
<ClInclude Include="hash_combine.h" />
|
<ClInclude Include="hash_combine.h" />
|
||||||
<ClInclude Include="heap_array.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="image.h" />
|
||||||
<ClInclude Include="iso_reader.h" />
|
<ClInclude Include="iso_reader.h" />
|
||||||
<ClInclude Include="jit_code_buffer.h" />
|
<ClInclude Include="jit_code_buffer.h" />
|
||||||
|
@ -125,6 +132,13 @@
|
||||||
<ClCompile Include="gl\shader_cache.cpp" />
|
<ClCompile Include="gl\shader_cache.cpp" />
|
||||||
<ClCompile Include="gl\stream_buffer.cpp" />
|
<ClCompile Include="gl\stream_buffer.cpp" />
|
||||||
<ClCompile Include="gl\texture.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="image.cpp" />
|
||||||
<ClCompile Include="iso_reader.cpp" />
|
<ClCompile Include="iso_reader.cpp" />
|
||||||
<ClCompile Include="jit_code_buffer.cpp" />
|
<ClCompile Include="jit_code_buffer.cpp" />
|
||||||
|
|
|
@ -134,6 +134,9 @@
|
||||||
<ClInclude Include="d3d12\shader_cache.h">
|
<ClInclude Include="d3d12\shader_cache.h">
|
||||||
<Filter>d3d12</Filter>
|
<Filter>d3d12</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="http_downloader_uwp.h" />
|
||||||
|
<ClInclude Include="http_downloader_winhttp.h" />
|
||||||
|
<ClInclude Include="http_downloader.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="jit_code_buffer.cpp" />
|
<ClCompile Include="jit_code_buffer.cpp" />
|
||||||
|
@ -264,6 +267,9 @@
|
||||||
<Filter>d3d12</Filter>
|
<Filter>d3d12</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="cd_image_device.cpp" />
|
<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>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Natvis Include="bitfield.natvis" />
|
<Natvis Include="bitfield.natvis" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "http_downloader.h"
|
#include "http_downloader.h"
|
||||||
#include "common/assert.h"
|
#include "assert.h"
|
||||||
#include "common/log.h"
|
#include "log.h"
|
||||||
#include "common/timer.h"
|
#include "timer.h"
|
||||||
Log_SetChannel(HTTPDownloader);
|
Log_SetChannel(HTTPDownloader);
|
||||||
|
|
||||||
static constexpr float DEFAULT_TIMEOUT_IN_SECONDS = 30;
|
static constexpr float DEFAULT_TIMEOUT_IN_SECONDS = 30;
|
|
@ -1,8 +1,8 @@
|
||||||
#include "http_downloader_uwp.h"
|
#include "http_downloader_uwp.h"
|
||||||
#include "common/assert.h"
|
#include "assert.h"
|
||||||
#include "common/log.h"
|
#include "log.h"
|
||||||
#include "common/string_util.h"
|
#include "string_util.h"
|
||||||
#include "common/timer.h"
|
#include "timer.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
Log_SetChannel(HTTPDownloaderWinHttp);
|
Log_SetChannel(HTTPDownloaderWinHttp);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#pragma once
|
||||||
#include "http_downloader.h"
|
#include "http_downloader.h"
|
||||||
|
|
||||||
#include "common/windows_headers.h"
|
#include "common/windows_headers.h"
|
|
@ -1,8 +1,8 @@
|
||||||
#include "http_downloader_winhttp.h"
|
#include "http_downloader_winhttp.h"
|
||||||
#include "common/assert.h"
|
#include "assert.h"
|
||||||
#include "common/log.h"
|
#include "log.h"
|
||||||
#include "common/string_util.h"
|
#include "string_util.h"
|
||||||
#include "common/timer.h"
|
#include "timer.h"
|
||||||
#include <VersionHelpers.h>
|
#include <VersionHelpers.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
Log_SetChannel(HTTPDownloaderWinHttp);
|
Log_SetChannel(HTTPDownloaderWinHttp);
|
|
@ -113,25 +113,6 @@ if(ENABLE_DISCORD_PRESENCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CHEEVOS)
|
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
|
target_sources(frontend-common PRIVATE
|
||||||
cheevos.cpp
|
cheevos.cpp
|
||||||
cheevos.h
|
cheevos.h
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "cheevos.h"
|
#include "cheevos.h"
|
||||||
#include "common/cd_image.h"
|
#include "common/cd_image.h"
|
||||||
#include "common/file_system.h"
|
#include "common/file_system.h"
|
||||||
|
#include "common/http_downloader.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/md5_digest.h"
|
#include "common/md5_digest.h"
|
||||||
#include "common/platform.h"
|
#include "common/platform.h"
|
||||||
|
@ -13,7 +14,6 @@
|
||||||
#include "core/host_display.h"
|
#include "core/host_display.h"
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
#include "fullscreen_ui.h"
|
#include "fullscreen_ui.h"
|
||||||
#include "http_downloader.h"
|
|
||||||
#include "imgui_fullscreen.h"
|
#include "imgui_fullscreen.h"
|
||||||
#include "rapidjson/document.h"
|
#include "rapidjson/document.h"
|
||||||
#include "rc_url.h"
|
#include "rc_url.h"
|
||||||
|
|
|
@ -17,13 +17,6 @@
|
||||||
<ClCompile Include="d3d12_host_display.cpp" />
|
<ClCompile Include="d3d12_host_display.cpp" />
|
||||||
<ClCompile Include="game_list.cpp" />
|
<ClCompile Include="game_list.cpp" />
|
||||||
<ClCompile Include="game_settings.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="icon.cpp" />
|
||||||
<ClCompile Include="imgui_fullscreen.cpp" />
|
<ClCompile Include="imgui_fullscreen.cpp" />
|
||||||
<ClCompile Include="imgui_impl_dx11.cpp" />
|
<ClCompile Include="imgui_impl_dx11.cpp" />
|
||||||
|
@ -69,13 +62,6 @@
|
||||||
<ClInclude Include="d3d12_host_display.h" />
|
<ClInclude Include="d3d12_host_display.h" />
|
||||||
<ClInclude Include="game_list.h" />
|
<ClInclude Include="game_list.h" />
|
||||||
<ClInclude Include="game_settings.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="icon.h" />
|
||||||
<ClInclude Include="imgui_fullscreen.h" />
|
<ClInclude Include="imgui_fullscreen.h" />
|
||||||
<ClInclude Include="imgui_impl_dx11.h" />
|
<ClInclude Include="imgui_impl_dx11.h" />
|
||||||
|
|
|
@ -28,15 +28,12 @@
|
||||||
<ClCompile Include="fullscreen_ui.cpp" />
|
<ClCompile Include="fullscreen_ui.cpp" />
|
||||||
<ClCompile Include="fullscreen_ui_progress_callback.cpp" />
|
<ClCompile Include="fullscreen_ui_progress_callback.cpp" />
|
||||||
<ClCompile Include="cheevos.cpp" />
|
<ClCompile Include="cheevos.cpp" />
|
||||||
<ClCompile Include="http_downloader.cpp" />
|
|
||||||
<ClCompile Include="http_downloader_winhttp.cpp" />
|
|
||||||
<ClCompile Include="input_overlay_ui.cpp" />
|
<ClCompile Include="input_overlay_ui.cpp" />
|
||||||
<ClCompile Include="game_database.cpp" />
|
<ClCompile Include="game_database.cpp" />
|
||||||
<ClCompile Include="inhibit_screensaver.cpp" />
|
<ClCompile Include="inhibit_screensaver.cpp" />
|
||||||
<ClCompile Include="xaudio2_audio_stream.cpp" />
|
<ClCompile Include="xaudio2_audio_stream.cpp" />
|
||||||
<ClCompile Include="d3d12_host_display.cpp" />
|
<ClCompile Include="d3d12_host_display.cpp" />
|
||||||
<ClCompile Include="imgui_impl_dx12.cpp" />
|
<ClCompile Include="imgui_impl_dx12.cpp" />
|
||||||
<ClCompile Include="http_downloader_uwp.cpp" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="icon.h" />
|
<ClInclude Include="icon.h" />
|
||||||
|
@ -66,15 +63,12 @@
|
||||||
<ClInclude Include="fullscreen_ui.h" />
|
<ClInclude Include="fullscreen_ui.h" />
|
||||||
<ClInclude Include="fullscreen_ui_progress_callback.h" />
|
<ClInclude Include="fullscreen_ui_progress_callback.h" />
|
||||||
<ClInclude Include="cheevos.h" />
|
<ClInclude Include="cheevos.h" />
|
||||||
<ClInclude Include="http_downloader.h" />
|
|
||||||
<ClInclude Include="http_downloader_winhttp.h" />
|
|
||||||
<ClInclude Include="input_overlay_ui.h" />
|
<ClInclude Include="input_overlay_ui.h" />
|
||||||
<ClInclude Include="game_database.h" />
|
<ClInclude Include="game_database.h" />
|
||||||
<ClInclude Include="inhibit_screensaver.h" />
|
<ClInclude Include="inhibit_screensaver.h" />
|
||||||
<ClInclude Include="xaudio2_audio_stream.h" />
|
<ClInclude Include="xaudio2_audio_stream.h" />
|
||||||
<ClInclude Include="d3d12_host_display.h" />
|
<ClInclude Include="d3d12_host_display.h" />
|
||||||
<ClInclude Include="imgui_impl_dx12.h" />
|
<ClInclude Include="imgui_impl_dx12.h" />
|
||||||
<ClInclude Include="http_downloader_uwp.h" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="font_roboto_regular.inl" />
|
<None Include="font_roboto_regular.inl" />
|
||||||
|
|
Loading…
Reference in a new issue