Remove needless build_settings.h includes. input_file_manager.h is a popular header and build_settings.h is slow to parse (mostly due to it including <functional>), and the include isn't even needed. Remove the include from settings.h and output_file.h too while here. Change-Id: If2e0993267bb6ba2d4588e3ef44e305e51e64904 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/6644 Commit-Queue: Scott Graham <scottmg@chromium.org> Reviewed-by: Scott Graham <scottmg@chromium.org>
diff --git a/src/gn/config_values_generator.cc b/src/gn/config_values_generator.cc index 918c6b1..e6c7c36 100644 --- a/src/gn/config_values_generator.cc +++ b/src/gn/config_values_generator.cc
@@ -5,6 +5,7 @@ #include "gn/config_values_generator.h" #include "base/strings/string_util.h" +#include "gn/build_settings.h" #include "gn/config_values.h" #include "gn/scope.h" #include "gn/settings.h"
diff --git a/src/gn/functions.cc b/src/gn/functions.cc index 57f93eb..91723f5 100644 --- a/src/gn/functions.cc +++ b/src/gn/functions.cc
@@ -11,6 +11,7 @@ #include "base/environment.h" #include "base/strings/string_util.h" +#include "gn/build_settings.h" #include "gn/config.h" #include "gn/config_values_generator.h" #include "gn/err.h"
diff --git a/src/gn/input_file_manager.h b/src/gn/input_file_manager.h index 32a97c7..c3633e8 100644 --- a/src/gn/input_file_manager.h +++ b/src/gn/input_file_manager.h
@@ -15,12 +15,12 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "gn/build_settings.h" #include "gn/input_file.h" #include "gn/parse_tree.h" #include "gn/settings.h" #include "util/auto_reset_event.h" +class BuildSettings; class Err; class LocationRange; class ParseNode;
diff --git a/src/gn/output_file.h b/src/gn/output_file.h index 543cf97..d8d69ff 100644 --- a/src/gn/output_file.h +++ b/src/gn/output_file.h
@@ -9,8 +9,8 @@ #include <string> -#include "gn/build_settings.h" - +class BuildSettings; +class SourceDir; class SourceFile; // A simple wrapper around a string that indicates the string is a path
diff --git a/src/gn/settings.h b/src/gn/settings.h index e3b6ed2..1ae3d38 100644 --- a/src/gn/settings.h +++ b/src/gn/settings.h
@@ -7,13 +7,14 @@ #include "base/files/file_path.h" #include "base/macros.h" -#include "gn/build_settings.h" #include "gn/import_manager.h" #include "gn/output_file.h" #include "gn/scope.h" #include "gn/source_dir.h" #include "gn/toolchain.h" +class BuildSettings; + // Holds the settings for one toolchain invocation. There will be one // Settings object for each toolchain type, each referring to the same // BuildSettings object for shared stuff.