![]() On the console you should see output like this:ĮRROR: /home/gabor/src/core/include/tools/inetmime.hxx:26: tools/debug.hxx: remove not needed includeĮRROR: The following command found unused includes: For quickly checking all files in a directory use the -recursive directoryname switch.This can and usually should be changed with the -continue switch. Another default mode of operation is to stop after one file contains issues to be fixed.This can be modified with the -headers switch. The default mode of operation of the tool is to check the c/.cxx files, and not header files.All top-level modules (that contain C/C++ sources) can and should be checked this way from time to time. ![]() It is recommended to use the latter option, so that you can get lots of files checked at once. Or recursively on a whole module directory:īin/find-unneeded-includes -recursive sc On a directory containing files that are matching a glob pattern:īin/find-unneeded-includes sc/source/filter/excel/*cxx Once this is successful, you can run FUI on individual files:īin/find-unneeded-includes sc/inc/address.hxx Since the LibreOffice code base is huge and has some historical idiosyncracies, also because include-what-you-use is at best an alpha-quality software, a Python script was developed to help working with these two, named bin/find-unneeded-includes (FUI).īefore running this script, you need to issue the following command: Now you are ready to start analyzing the LibreOffice sources! ![]() Make sure to install the following packages: The trick is that the new IWYU versions are matching new Clang versions, so you need to get the latest Clang version possible on your current distribution, then download the IWYU version matching that from the downloads page.įor Debian/Ubuntu versions it is worth adding the repositories to get the latest&greatest LLVM+Clang toolchain. Your version choices might be limited by the available LLVM+Clang toolchain versions on your OS, but it should be okay to build a somewhat older version. This tutorial is made for Linux based systems.Īs a first step you need to download and build a fresh version of the (from now: IWYU) tool. We use the include-what-you-use tool and a wrapper script called bin/find-unneeded-includes (from now: FUI) for this goal. This page discusses how can you efficiently detect and remove unnecessary headers from the LibreOffice sources. ![]() Removing unnecessary headers from LibreOffice sources
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |