aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-08-22 18:40:03 +0300
committerGitHub <noreply@github.com>2020-08-22 18:40:03 +0300
commite9a71ebf60a91443ae024dea94a8b68d46987589 (patch)
tree9dee7c38fb246d8e7f351437d06a4fb7214fcde8 /mesonbuild/compilers
parentc42298e1460f838710bfe1d33b5635bec25fa8ba (diff)
parent847bb4347039e8f52c661a6d9cddd411f42b41ed (diff)
downloadmeson-e9a71ebf60a91443ae024dea94a8b68d46987589.zip
meson-e9a71ebf60a91443ae024dea94a8b68d46987589.tar.gz
meson-e9a71ebf60a91443ae024dea94a8b68d46987589.tar.bz2
Merge pull request #7607 from bonzini/speedup
Various speedups from profiling QEMU's meson.build
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/mixins/clike.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 95b9592..4311fa5 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -40,7 +40,9 @@ from .visualstudio import VisualStudioLikeCompiler
if T.TYPE_CHECKING:
from ...environment import Environment
-SOREGEX = re.compile(r'.*\.so(\.[0-9]+)?(\.[0-9]+)?(\.[0-9]+)?$')
+GROUP_FLAGS = re.compile(r'''\.so (?:\.[0-9]+)? (?:\.[0-9]+)? (?:\.[0-9]+)?$ |
+ ^(?:-Wl,)?-l |
+ \.a$''', re.X)
class CLikeCompilerArgs(arglist.CompilerArgs):
prepend_prefixes = ('-I', '-L')
@@ -69,8 +71,7 @@ class CLikeCompilerArgs(arglist.CompilerArgs):
group_start = -1
group_end = -1
for i, each in enumerate(new):
- if not each.startswith(('-Wl,-l', '-l')) and not each.endswith('.a') and \
- not SOREGEX.match(each):
+ if not GROUP_FLAGS.search(each):
continue
group_end = i
if group_start < 0:
@@ -85,6 +86,9 @@ class CLikeCompilerArgs(arglist.CompilerArgs):
default_dirs = self.compiler.get_default_include_dirs()
bad_idx_list = [] # type: T.List[int]
for i, each in enumerate(new):
+ if not each.startswith('-isystem'):
+ continue
+
# Remove the -isystem and the path if the path is a default path
if (each == '-isystem' and
i < (len(new) - 1) and
@@ -92,7 +96,7 @@ class CLikeCompilerArgs(arglist.CompilerArgs):
bad_idx_list += [i, i + 1]
elif each.startswith('-isystem=') and each[9:] in default_dirs:
bad_idx_list += [i]
- elif each.startswith('-isystem') and each[8:] in default_dirs:
+ elif each[8:] in default_dirs:
bad_idx_list += [i]
for i in reversed(bad_idx_list):
new.pop(i)