bin/find-unneeded-includes | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
New commits: commit 980437e7380077e008b7e145b472c8c79b89d83e Author: Gabor Kelemen <[email protected]> AuthorDate: Thu Oct 16 22:52:23 2025 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Nov 7 08:36:42 2025 +0100 bin/find-unneeded-includes: exclude some paths from checking individual files and dirs with many files as well, if they are related to any non-linux build, such as Win, Mac, Emscripten, IOS, Android Preparation for making this everybody elses problem, but for now, only on linux builders Change-Id: I94b0c76a8d7043538df930379e0703af7416bb3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192750 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes index 405a6c9286a2..5cd11c696c36 100755 --- a/bin/find-unneeded-includes +++ b/bin/find-unneeded-includes @@ -514,6 +514,25 @@ def isInUnoIncludeFile(path): or path.startswith("include/typelib/") \ or path.startswith("include/uno/") +# Don't bother with non-linux specific paths, +# useful for automatically checking headers +def isNonLinuxPath(path): + return path.startswith("avmedia/source/win/") \ + or path.startswith("avmedia/source/macavf/") \ + or path.startswith("include/apple_remote/") + +def isNonLinuxFile(path): + NonLinuxFiles = ( + "include/comphelper/windowserrorstring.hxx", + "include/comphelper/windowsdebugoutput.hxx", + "include/comphelper/windowsStart.hxx", + "include/drawinglayer/processor2d/d2dpixelprocessor2d.hxx", + "include/static/unoembindhelpers/PrimaryBindings.hxx", + "include/version.hrc", + "include/vcl/winscheduler.hxx", + ) + if path in NonLinuxFiles: + return True def tidy(compileCommands, paths, dontstop, noexclude, checknamespaces, finderrors, removefwdd, debug, headersfwd): return_code = 0 @@ -528,7 +547,7 @@ def tidy(compileCommands, paths, dontstop, noexclude, checknamespaces, finderror t.start() for path in sorted(paths): - if isInUnoIncludeFile(path): + if isInUnoIncludeFile(path) or isNonLinuxFile(path) or isNonLinuxPath(path): continue # IWYU fails on these with #error: don't use this in new code
