Fix pro2cmake formatting

... by running make format.

Change-Id: I523a48abd2c483107f5c16c24daa695fcc0a55e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CMake Build Bot
This commit is contained in:
Simon Hausmann 2019-11-22 18:26:41 +01:00
parent a640db0180
commit 4ff9d6d523
2 changed files with 12 additions and 15 deletions

View File

@ -1396,9 +1396,11 @@ def unwrap_if(input_string):
def map_condition(condition: str) -> str: def map_condition(condition: str) -> str:
# Some hardcoded cases that are too bothersome to generalize. # Some hardcoded cases that are too bothersome to generalize.
condition = re.sub(r"qtConfig\(opengles\.\)", condition = re.sub(
r"(QT_FEATURE_opengles2 OR QT_FEATURE_opengles3 OR QT_FEATURE_opengles31 OR QT_FEATURE_opengles32)", r"qtConfig\(opengles\.\)",
condition) r"(QT_FEATURE_opengles2 OR QT_FEATURE_opengles3 OR QT_FEATURE_opengles31 OR QT_FEATURE_opengles32)",
condition,
)
condition = re.sub( condition = re.sub(
r"qtConfig\(opengl\(es1\|es2\)\?\)", r"qtConfig\(opengl\(es1\|es2\)\?\)",
r"QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3", r"QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3",
@ -1510,12 +1512,10 @@ def map_condition(condition: str) -> str:
condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition) condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition)
# some defines replacements # some defines replacements
condition = re.sub(r"DEFINES___contains___QT_NO_CURSOR", condition = re.sub(r"DEFINES___contains___QT_NO_CURSOR", r"(NOT QT_FEATURE_cursor)", condition)
r"(NOT QT_FEATURE_cursor)", condition = re.sub(
condition) r"DEFINES___contains___QT_NO_TRANSLATION", r"(NOT QT_FEATURE_translation)", condition
condition = re.sub(r"DEFINES___contains___QT_NO_TRANSLATION", )
r"(NOT QT_FEATURE_translation)",
condition)
cmake_condition = "" cmake_condition = ""
for part in condition.split(): for part in condition.split():

View File

@ -74,10 +74,7 @@ def parse_command_line() -> argparse.Namespace:
help="Run pro2cmake with --is-example flag.", help="Run pro2cmake with --is-example flag.",
) )
parser.add_argument( parser.add_argument(
"--count", "--count", dest="count", help="How many projects should be converted.", type=int
dest="count",
help="How many projects should be converted.",
type=int,
) )
parser.add_argument( parser.add_argument(
"--offset", "--offset",
@ -227,9 +224,9 @@ def main() -> None:
all_files = find_all_pro_files(base_path, args) all_files = find_all_pro_files(base_path, args)
if args.offset: if args.offset:
all_files = all_files[args.offset:] all_files = all_files[args.offset :]
if args.count: if args.count:
all_files = all_files[:args.count] all_files = all_files[: args.count]
files_count = len(all_files) files_count = len(all_files)
failed_files = run(all_files, pro2cmake, args) failed_files = run(all_files, pro2cmake, args)