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-03 22:45:55 +08:00
parent 5704fa348f
commit 0a30cfe6b0
566 changed files with 1427 additions and 565 deletions
+3 -2
View File
@@ -4,7 +4,6 @@
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/catch_message.hpp>
#include "libslic3r/libslic3r.h"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include "libslic3r/MultiNozzleUtils.hpp"
#include "libslic3r/PrintConfig.hpp"
@@ -15,7 +14,6 @@
#include <cstddef>
#include <fstream>
#include <iomanip>
#include "libslic3r/ExtrusionEntity.hpp"
#include <ios>
#include <map>
#include <math.h>
@@ -23,6 +21,9 @@
#include <sstream>
#include <string>
#include <vector>
#include "libslic3r/Config.hpp"
namespace Slic3r { enum ExtrusionRole : uint8_t; }
using namespace Slic3r;
using Catch::Matchers::WithinAbs;