mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Fix compilation without ENABLE_WEB_SERVICE (#6856)
This commit is contained in:
		
							parent
							
								
									aaeba6759e
								
							
						
					
					
						commit
						0048e61fc7
					
				
					 9 changed files with 60 additions and 54 deletions
				
			
		|  | @ -461,14 +461,6 @@ add_library(citra_core STATIC | |||
|     perf_stats.cpp | ||||
|     perf_stats.h | ||||
|     precompiled_headers.h | ||||
|     rpc/packet.cpp | ||||
|     rpc/packet.h | ||||
|     rpc/rpc_server.cpp | ||||
|     rpc/rpc_server.h | ||||
|     rpc/server.cpp | ||||
|     rpc/server.h | ||||
|     rpc/udp_server.cpp | ||||
|     rpc/udp_server.h | ||||
|     savestate.cpp | ||||
|     savestate.h | ||||
|     system_titles.cpp | ||||
|  | @ -483,18 +475,32 @@ add_library(citra_core STATIC | |||
| create_target_directory_groups(citra_core) | ||||
| 
 | ||||
| target_link_libraries(citra_core PUBLIC citra_common PRIVATE audio_core network video_core) | ||||
| target_link_libraries(citra_core PRIVATE Boost::boost Boost::serialization Boost::iostreams) | ||||
| target_link_libraries(citra_core PRIVATE Boost::boost Boost::serialization Boost::iostreams httplib) | ||||
| target_link_libraries(citra_core PUBLIC dds-ktx PRIVATE cryptopp fmt::fmt lodepng open_source_archives) | ||||
| set_target_properties(citra_core PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${ENABLE_LTO}) | ||||
| 
 | ||||
| if (ENABLE_WEB_SERVICE) | ||||
|     target_compile_definitions(citra_core PRIVATE -DENABLE_WEB_SERVICE -DCPPHTTPLIB_OPENSSL_SUPPORT) | ||||
|     target_link_libraries(citra_core PRIVATE web_service ${OPENSSL_LIBS} httplib) | ||||
|     target_compile_definitions(citra_core PRIVATE -DENABLE_WEB_SERVICE) | ||||
|     target_link_libraries(citra_core PRIVATE web_service) | ||||
|     if (ANDROID) | ||||
|         target_link_libraries(citra_core PRIVATE ifaddrs) | ||||
|     endif() | ||||
| endif() | ||||
| 
 | ||||
| if (ENABLE_SCRIPTING) | ||||
|     target_compile_definitions(citra_core PRIVATE -DENABLE_SCRIPTING) | ||||
|     target_sources(citra_core PRIVATE | ||||
|         rpc/packet.cpp | ||||
|         rpc/packet.h | ||||
|         rpc/rpc_server.cpp | ||||
|         rpc/rpc_server.h | ||||
|         rpc/server.cpp | ||||
|         rpc/server.h | ||||
|         rpc/udp_server.cpp | ||||
|         rpc/udp_server.h | ||||
|     ) | ||||
| endif() | ||||
| 
 | ||||
| if ("x86_64" IN_LIST ARCHITECTURE OR "arm64" IN_LIST ARCHITECTURE) | ||||
|     target_sources(citra_core PRIVATE | ||||
|         arm/dynarmic/arm_dynarmic.cpp | ||||
|  |  | |||
|  | @ -45,7 +45,9 @@ | |||
| #include "core/hw/lcd.h" | ||||
| #include "core/loader/loader.h" | ||||
| #include "core/movie.h" | ||||
| #ifdef ENABLE_SCRIPTING | ||||
| #include "core/rpc/server.h" | ||||
| #endif | ||||
| #include "core/telemetry_session.h" | ||||
| #include "network/network.h" | ||||
| #include "video_core/custom_textures/custom_tex_manager.h" | ||||
|  | @ -418,7 +420,9 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, | |||
| 
 | ||||
|     telemetry_session = std::make_unique<Core::TelemetrySession>(); | ||||
| 
 | ||||
| #ifdef ENABLE_SCRIPTING | ||||
|     rpc_server = std::make_unique<RPC::Server>(*this); | ||||
| #endif | ||||
| 
 | ||||
|     service_manager = std::make_unique<Service::SM::ServiceManager>(*this); | ||||
|     archive_manager = std::make_unique<Service::FS::ArchiveManager>(*this); | ||||
|  | @ -555,7 +559,9 @@ void System::Shutdown(bool is_deserializing) { | |||
|     } | ||||
|     custom_tex_manager.reset(); | ||||
|     telemetry_session.reset(); | ||||
| #ifdef ENABLE_SCRIPTING | ||||
|     rpc_server.reset(); | ||||
| #endif | ||||
|     archive_manager.reset(); | ||||
|     service_manager.reset(); | ||||
|     dsp_core.reset(); | ||||
|  |  | |||
|  | @ -405,8 +405,10 @@ private: | |||
|     /// Image interface
 | ||||
|     std::shared_ptr<Frontend::ImageInterface> registered_image_interface; | ||||
| 
 | ||||
| #ifdef ENABLE_SCRIPTING | ||||
|     /// RPC Server for scripting support
 | ||||
|     std::unique_ptr<RPC::Server> rpc_server; | ||||
| #endif | ||||
| 
 | ||||
|     std::unique_ptr<Service::FS::ArchiveManager> archive_manager; | ||||
| 
 | ||||
|  |  | |||
|  | @ -77,7 +77,6 @@ static std::pair<std::string, std::string> SplitUrl(const std::string& url) { | |||
| void Context::MakeRequest() { | ||||
|     ASSERT(state == RequestState::NotStarted); | ||||
| 
 | ||||
| #ifdef ENABLE_WEB_SERVICE | ||||
|     const auto& [host, path] = SplitUrl(url); | ||||
|     const auto client = std::make_unique<httplib::Client>(host); | ||||
|     SSL_CTX* ctx = client->ssl_context(); | ||||
|  | @ -128,10 +127,6 @@ void Context::MakeRequest() { | |||
|         // TODO(B3N30): Verify this state on HW
 | ||||
|         state = RequestState::ReadyToDownloadContent; | ||||
|     } | ||||
| #else | ||||
|     LOG_ERROR(Service_HTTP, "Tried to make request but WebServices is not enabled in this build"); | ||||
|     state = RequestState::TimedOut; | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| void HTTP_C::Initialize(Kernel::HLERequestContext& ctx) { | ||||
|  |  | |||
|  | @ -17,12 +17,10 @@ | |||
| #include <boost/serialization/unordered_map.hpp> | ||||
| #include <boost/serialization/vector.hpp> | ||||
| #include <boost/serialization/weak_ptr.hpp> | ||||
| #ifdef ENABLE_WEB_SERVICE | ||||
| #if defined(__ANDROID__) | ||||
| #include <ifaddrs.h> | ||||
| #endif | ||||
| #include <httplib.h> | ||||
| #endif | ||||
| #include "core/hle/kernel/shared_memory.h" | ||||
| #include "core/hle/service/service.h" | ||||
| 
 | ||||
|  | @ -217,9 +215,7 @@ public: | |||
|     std::future<void> request_future; | ||||
|     std::atomic<u64> current_download_size_bytes; | ||||
|     std::atomic<u64> total_download_size_bytes; | ||||
| #ifdef ENABLE_WEB_SERVICE | ||||
|     httplib::Response response; | ||||
| #endif | ||||
| }; | ||||
| 
 | ||||
| struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue