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-04 14:53:22 +08:00
parent 88346efceb
commit e374956d03
565 changed files with 1426 additions and 564 deletions
+12
View File
@@ -120,6 +120,18 @@
#include "Notebook.hpp"
#include "BitmapCache.hpp"
#include "BindDialog.hpp"
#include "slic3r/GUI/DeviceCore/DevUtil.h"
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/Format/bbs_3mf.hpp"
#include "libslic3r/GCode/ThumbnailData.hpp"
#include "libslic3r/GCode/ToolOrdering.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "slic3r/GUI/Jobs/BindJob.hpp"
#include "slic3r/GUI/Tabbook.hpp"
#include "slic3r/GUI/Widgets/ComboBox.hpp"
#include "slic3r/GUI/Widgets/PopupWindow.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;