diff --git a/src/client/client.h b/src/client/client.h index 9f898e78ab63..42049791f1cd 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -36,9 +36,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "network/peerhandler.h" #include "gameparams.h" #include "clientdynamicinfo.h" -#include #include "util/numeric.h" +#ifdef SERVER +#error Do not include in server builds +#endif + #define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f struct ClientEvent; diff --git a/src/client/clientenvironment.h b/src/client/clientenvironment.h index 407473be7524..bdb8b97260d6 100644 --- a/src/client/clientenvironment.h +++ b/src/client/clientenvironment.h @@ -24,6 +24,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "activeobjectmgr.h" // client::ActiveObjectMgr #include +#ifdef SERVER +#error Do not include in server builds +#endif + class ClientSimpleObject; class ClientMap; class ClientScripting; diff --git a/src/client/game.h b/src/client/game.h index c1e8bb0a5565..0282e5ea9411 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -22,6 +22,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes.h" #include +#ifdef SERVER +#error Do not include in server builds +#endif + class InputHandler; class ChatBackend; class RenderingEngine; diff --git a/src/client/renderingengine.h b/src/client/renderingengine.h index 948485d82dc8..b8ae62fc4b31 100644 --- a/src/client/renderingengine.h +++ b/src/client/renderingengine.h @@ -30,6 +30,10 @@ with this program; if not, write to the Free Software Foundation, Inc., // include the shadow mapper classes too #include "client/shadows/dynamicshadowsrender.h" +#ifdef SERVER +#error Do not include in server builds +#endif + struct VideoDriverInfo { std::string name; std::string friendly_name; diff --git a/src/client/sound.h b/src/client/sound.h index 132da708ecfa..8b19f7761a63 100644 --- a/src/client/sound.h +++ b/src/client/sound.h @@ -26,6 +26,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#ifdef SERVER +#error Do not include in server builds +#endif + struct SoundSpec; class SoundFallbackPathProvider diff --git a/src/main.cpp b/src/main.cpp index e7ec6dd53835..763a8ae37190 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,9 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "irrlichttypes.h" // must be included before anything irrlicht, see comment in the file +#include "irrlichttypes_bloated.h" #include "irrlicht.h" // createDevice -#include "irrlichttypes_extrabloated.h" #include "irrlicht_changes/printing.h" #include "benchmark/benchmark.h" #include "chat_interface.h" @@ -28,7 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "server.h" #include "filesys.h" #include "version.h" -#include "client/game.h" #include "defaultsettings.h" #include "gettext.h" #include "log.h" diff --git a/src/unittest/test.cpp b/src/unittest/test.cpp index 761c908135d5..1fd9001bfcf5 100644 --- a/src/unittest/test.cpp +++ b/src/unittest/test.cpp @@ -19,7 +19,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "test.h" -#include "client/sound.h" #include "nodedef.h" #include "itemdef.h" #include "dummygamedef.h" diff --git a/src/util/string.h b/src/util/string.h index ac45463d7f41..beb75b6d3288 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -20,7 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include "irrlichttypes_bloated.h" +#ifndef SERVER #include "irrString.h" +#endif #include #include #include @@ -732,6 +734,7 @@ inline std::string str_join(const std::vector &list, return oss.str(); } +#ifndef SERVER /** * Create a UTF8 std::string from an irr::core::stringw. */ @@ -749,6 +752,7 @@ inline irr::core::stringw utf8_to_stringw(std::string_view input) std::wstring str = utf8_to_wide(input); return irr::core::stringw(str.c_str(), str.size()); } +#endif /** * Sanitize the name of a new directory. This consists of two stages: