Modules: Don't build editor-specific classes in templates

They're moved to an `editor` subfolder so that we can easily handle them
separately.
This commit is contained in:
Rémi Verschelde
2022-03-28 14:10:28 +02:00
parent 41d075de58
commit 5fe6984639
23 changed files with 105 additions and 48 deletions

View File

@ -41,6 +41,8 @@ elif env["builtin_wslay"]:
module_obj = []
env_ws.add_source_files(module_obj, "*.cpp")
if env["tools"]:
env_ws.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.

View File

@ -30,11 +30,13 @@
#include "editor_debugger_server_websocket.h"
#ifdef TOOLS_ENABLED
#include "../remote_debugger_peer_websocket.h"
#include "core/config/project_settings.h"
#include "editor/editor_log.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "modules/websocket/remote_debugger_peer_websocket.h"
void EditorDebuggerServerWebSocket::_peer_connected(int p_id, String _protocol) {
pending_peers.push_back(p_id);
@ -129,3 +131,5 @@ EditorDebuggerServer *EditorDebuggerServerWebSocket::create(const String &p_prot
ERR_FAIL_COND_V(p_protocol != "ws://", nullptr);
return memnew(EditorDebuggerServerWebSocket);
}
#endif // TOOLS_ENABLED

View File

@ -31,8 +31,10 @@
#ifndef EDITOR_DEBUGGER_SERVER_WEBSOCKET_H
#define EDITOR_DEBUGGER_SERVER_WEBSOCKET_H
#ifdef TOOLS_ENABLED
#include "../websocket_server.h"
#include "editor/debugger/editor_debugger_server.h"
#include "modules/websocket/websocket_server.h"
class EditorDebuggerServerWebSocket : public EditorDebuggerServer {
GDCLASS(EditorDebuggerServerWebSocket, EditorDebuggerServer);
@ -60,4 +62,6 @@ public:
~EditorDebuggerServerWebSocket();
};
#endif // TOOLS_ENABLED
#endif // EDITOR_DEBUGGER_SERVER_WEBSOCKET_H

View File

@ -29,8 +29,10 @@
/*************************************************************************/
#include "register_types.h"
#include "core/config/project_settings.h"
#include "core/error/error_macros.h"
#ifdef JAVASCRIPT_ENABLED
#include "emscripten.h"
#include "emws_client.h"
@ -40,10 +42,11 @@
#include "wsl_client.h"
#include "wsl_server.h"
#endif
#ifdef TOOLS_ENABLED
#include "editor/debugger/editor_debugger_server.h"
#include "editor/editor_debugger_server_websocket.h"
#include "editor/editor_node.h"
#include "editor_debugger_server_websocket.h"
#endif
#ifdef TOOLS_ENABLED

View File

@ -31,13 +31,14 @@
#ifndef REMOTE_DEBUGGER_PEER_WEBSOCKET_H
#define REMOTE_DEBUGGER_PEER_WEBSOCKET_H
#ifdef JAVASCRIPT_ENABLED
#include "modules/websocket/emws_client.h"
#else
#include "modules/websocket/wsl_client.h"
#endif
#include "core/debugger/remote_debugger_peer.h"
#ifdef JAVASCRIPT_ENABLED
#include "emws_client.h"
#else
#include "wsl_client.h"
#endif
class RemoteDebuggerPeerWebSocket : public RemoteDebuggerPeer {
Ref<WebSocketClient> ws_client;
Ref<WebSocketPeer> ws_peer;