Extend handling of special condtions

Extend the hanlding of special condtions outside single line statements.
Conditions such as 'qtHaveModule(gui):qtConfig(opengl(es1|es2)?)' would
not be handled properly.

Change-Id: I992f75311b82d84c574c9cb4ef6d7d648f425d81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-08-08 14:34:56 +02:00
parent 5d7bb2e4f0
commit 5424c72ab6

View File

@ -978,10 +978,10 @@ def parseProFile(file: str, *, debug=False):
def map_condition(condition: str) -> str:
# Some hardcoded cases that are too bothersome to generalize.
condition = re.sub(r'^qtConfig\(opengl\(es1\|es2\)\?\)$',
condition = re.sub(r'qtConfig\(opengl\(es1\|es2\)\?\)',
r'QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3',
condition)
condition = re.sub(r'^qtConfig\(opengl\.\*\)$', r'QT_FEATURE_opengl', condition)
condition = re.sub(r'qtConfig\(opengl\.\*\)', r'QT_FEATURE_opengl', condition)
condition = re.sub(r'^win\*$', r'win', condition)
def gcc_version_handler(match_obj: re.Match):