diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-02-01 11:00:54 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-02-01 20:12:21 +0100 |
commit | 69e0d871ec1de2260f9213d3113464155eac173c (patch) | |
tree | 8e2d70bcd7eaef2c0dec275dd89050bf499e17b9 /bin | |
parent | 961f7e8ec8ef188c361b2b20b60b95e78ecccd33 (diff) |
make update_pch also consider files in <module>/src/**/inc
With --enable-pch=full there's not much difference between a "public"
header in <module>/inc and a private one in <module>/src/somewhere/inc .
And since the script searches recursively, this apparently helps to
find even more headers for lower pch levels.
Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update_pch | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/bin/update_pch b/bin/update_pch index 192d78f9c0b3..63e1d95faeec 100755 --- a/bin/update_pch +++ b/bin/update_pch @@ -27,6 +27,7 @@ import sys import re import os import unittest +import glob CUTOFF = 1 EXCLUDE_MODULE = False @@ -200,16 +201,21 @@ def is_c_runtime(inc, root, module): if inc.endswith('.h') and inc.startswith( 'config_' ): return False + hasdot = False for c in inc: if c == '/': return False if c == '.' and not inc.endswith('.h'): return False + if c == '.': + hasdot = True if c.isupper(): return False + if not hasdot: # <memory> etc. + return True - if os.path.isfile( os.path.join(root, module, 'inc', inc)): - return False + if glob.glob(os.path.join(root, module, '**', inc), recursive=True): + return False; return True @@ -315,7 +321,17 @@ class Filter_Local(object): # Locals are included first (by the compiler). if self.is_local(filename): - return line if self.allow_locals and '/inc/' in filename else '' + # Use only locals that are in some /inc/ directory (either in <module>/inc or + # somewhere under <module>/source/**/inc/, compilations use -I for these paths + # and headers elsewhere would not be found when compiling the PCH. + if not self.allow_locals: + return '' + elif '/inc/' in filename: + return filename + elif glob.glob(os.path.join(self.root, self.module, '**', 'inc', filename), recursive=True): + return filename + else: + return '' # Module headers are next. if self.is_module(filename): @@ -376,6 +392,9 @@ def filter_ignore(line, module): ignore_list += [ 'com/sun/star/beans/PropertyAttribute.hpp', # OPTIONAL defined via objbase.h 'com/sun/star/sdbcx/Privilege.hpp', # DELETE defined via objbase.h + 'ado/*' , # some strange type conflict because of Window's adoctint.h + 'adoint.h', + 'adoctint.h', ] if module == 'sc': ignore_list += [ |