Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced

Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.

clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.
This commit is contained in:
Hanif Koh
2026-10-05 11:02:06 +08:00
parent f3d0b8a553
commit e540bbcf35
562 changed files with 1420 additions and 560 deletions
+9 -1
View File
@@ -75,7 +75,6 @@
#include "libslic3r/ClipperUtils.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Geometry.hpp"
#include "libslic3r/Tesselate.hpp"
#include "libslic3r/GCode/ThumbnailData.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/LifecycleEvents.hpp"
@@ -106,6 +105,15 @@
#include <wx/event.h>
#include <wx/image.h>
#include <wx/gdicmn.h>
#include "libslic3r/ObjectID.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/SLA/Pad.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GLModel.hpp"
class wxFont;
namespace boost { template <class T> class optional; }
using boost::optional;
namespace fs = boost::filesystem;