From e7948508d73e44d930daa325353aac64f0405fca Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Thu, 11 Jul 2019 16:22:16 +0200 Subject: [PATCH] cmake: trace: set_target_properties improved property detection --- mesonbuild/cmake/traceparser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py index 4b87319ff..3b9f92b4b 100644 --- a/mesonbuild/cmake/traceparser.py +++ b/mesonbuild/cmake/traceparser.py @@ -343,8 +343,8 @@ class CMakeTraceParser: # set_property() this is not context free. There are two approaches I # can think of, both have drawbacks: # - # 1. Assume that the property will be capitalized, this is convention - # but cmake doesn't require it. + # 1. Assume that the property will be capitalized ([A-Z_]), this is + # convention but cmake doesn't require it. # 2. Maintain a copy of the list here: https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#target-properties # # Neither of these is awesome for obvious reasons. I'm going to try @@ -354,8 +354,9 @@ class CMakeTraceParser: arglist = [] # type: List[Tuple[str, List[str]]] name = args.pop(0) values = [] + prop_regex = re.compile(r'^[A-Z_]+$') for a in args: - if a.isupper(): + if prop_regex.match(a): if values: arglist.append((name, ' '.join(values).split(';'))) name = a