diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-09 17:39:23 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-09 23:46:50 +0200 |
commit | f1723ed1c5788fe186cc29e01cb919f635cbd861 (patch) | |
tree | ec6d83bdfd31e2bc9c223733a5e592adff44794c /util | |
parent | 54443adaca7fe33d7b481a0e4d2067aa41636a4c (diff) |
pro2cmake: run make format to fix styling issues
Change-Id: I718e34d628576bb709096c0672da3a69b71ae8df
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 21a281d9622b22fa8bd6f731226eff8e5ee9802d)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'util')
-rw-r--r-- | util/cmake/condition_simplifier.py | 8 | ||||
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 23 | ||||
-rw-r--r-- | util/cmake/helper.py | 44 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 10 |
4 files changed, 58 insertions, 27 deletions
diff --git a/util/cmake/condition_simplifier.py b/util/cmake/condition_simplifier.py index e6588a7cc7..e8fc0e40d2 100644 --- a/util/cmake/condition_simplifier.py +++ b/util/cmake/condition_simplifier.py @@ -72,8 +72,8 @@ def _simplify_expressions(expr, op, matches, replacement): def _simplify_flavors_in_condition(base: str, flavors, expr): - """ Simplify conditions based on the knowledge of which flavors - belong to which OS. """ + """Simplify conditions based on the knowledge of which flavors + belong to which OS.""" base_expr = simplify_logic(base) false_expr = simplify_logic("false") for flavor in flavors: @@ -100,8 +100,8 @@ def _simplify_os_families(expr, family_members, other_family_members): def _recursive_simplify(expr): - """ Simplify the expression as much as possible based on - domain knowledge. """ + """Simplify the expression as much as possible based on + domain knowledge.""" input_expr = expr # Simplify even further, based on domain knowledge: diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index b5e148f63c..3be7118080 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -611,7 +611,7 @@ def write_compile_test( head = detail.get("head") if isinstance(head, list): head = "\n".join(head) - return head + '\n' if head else '' + return head + "\n" if head else "" head = "" if inherit_details: @@ -646,7 +646,7 @@ def write_compile_test( tail = detail.get("tail") if isinstance(tail, list): tail = "\n".join(tail) - return tail + '\n' if tail else '' + return tail + "\n" if tail else "" tail = "" if inherit_details: @@ -655,8 +655,8 @@ def write_compile_test( sourceCode += tail - if sourceCode: # blank line before main - sourceCode += '\n' + if sourceCode: # blank line before main + sourceCode += "\n" sourceCode += "int main(void)\n" sourceCode += "{\n" sourceCode += " /* BEGIN TEST: */\n" @@ -665,7 +665,7 @@ def write_compile_test( main = detail.get("main") if isinstance(main, list): main = "\n".join(main) - return main + '\n' if main else '' + return main + "\n" if main else "" main = "" if inherit_details: @@ -943,7 +943,11 @@ endif()""", "qreal": { "condition": 'DEFINED QT_COORD_TYPE AND NOT QT_COORD_TYPE STREQUAL "double"', "output": [ - {"type": "define", "name": "QT_COORD_TYPE", "value": "${QT_COORD_TYPE}",}, + { + "type": "define", + "name": "QT_COORD_TYPE", + "value": "${QT_COORD_TYPE}", + }, { "type": "define", "name": "QT_COORD_TYPE_STRING", @@ -951,7 +955,9 @@ endif()""", }, ], }, - "reduce_exports": {"condition": "NOT MSVC",}, + "reduce_exports": { + "condition": "NOT MSVC", + }, "release": None, "release_tools": None, "rpath": { @@ -1524,6 +1530,7 @@ class special_cased_file: self.sc_handler.handle_special_cases() os.replace(self.gen_file_path, self.file_path) + def processJson(path, ctx, data, skip_special_case_preservation=False): ctx["project_dir"] = path ctx["module"] = data.get("module", "global") @@ -1571,7 +1578,7 @@ def main(): quit(1) directory = sys.argv[1] - skip_special_case_preservation = '-s' in sys.argv[2:] + skip_special_case_preservation = "-s" in sys.argv[2:] print(f"Processing: {directory}.") diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 298e7cbf68..e55a94125c 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -148,7 +148,10 @@ _qt_library_map = [ extra=["COMPONENTS", "EglFSDeviceIntegrationPrivate"], ), LibraryMapping( - "eglfs_kms_support", "Qt6", "Qt::EglFsKmsSupportPrivate", extra=["COMPONENTS", "EglFsKmsSupportPrivate"] + "eglfs_kms_support", + "Qt6", + "Qt::EglFsKmsSupportPrivate", + extra=["COMPONENTS", "EglFsKmsSupportPrivate"], ), LibraryMapping( "eglfs_kms_gbm_support", @@ -170,8 +173,12 @@ _qt_library_map = [ "Qt::EventDispatcherSupport", extra=["COMPONENTS", "EventDispatcherSupport"], ), - LibraryMapping("fbconvenience", "Qt6", "Qt::FbSupportPrivate", extra=["COMPONENTS", "FbSupportPrivate"]), - LibraryMapping("fb_support", "Qt6", "Qt::FbSupportPrivate", extra=["COMPONENTS", "FbSupportPrivate"]), + LibraryMapping( + "fbconvenience", "Qt6", "Qt::FbSupportPrivate", extra=["COMPONENTS", "FbSupportPrivate"] + ), + LibraryMapping( + "fb_support", "Qt6", "Qt::FbSupportPrivate", extra=["COMPONENTS", "FbSupportPrivate"] + ), LibraryMapping( "fontdatabase_support", "Qt6", @@ -195,9 +202,14 @@ _qt_library_map = [ "Qt::HunspellInputMethod", extra=["COMPONENTS", "HunspellInputMethod"], ), - LibraryMapping("input", "Qt6", "Qt::InputSupportPrivate", extra=["COMPONENTS", "InputSupportPrivate"]), LibraryMapping( - "input_support", "Qt6", "Qt::InputSupportPrivate", extra=["COMPONENTS", "InputSupportPrivate"] + "input", "Qt6", "Qt::InputSupportPrivate", extra=["COMPONENTS", "InputSupportPrivate"] + ), + LibraryMapping( + "input_support", + "Qt6", + "Qt::InputSupportPrivate", + extra=["COMPONENTS", "InputSupportPrivate"], ), LibraryMapping( "installer-lib", "Qt6", "Qt::AppManInstaller", extra=["COMPONENTS", "AppManInstaller"] @@ -206,8 +218,12 @@ _qt_library_map = [ LibraryMapping("ivicore", "Qt6", "Qt::IviCore", extra=["COMPONENTS", "IviCore"]), LibraryMapping("ivimedia", "Qt6", "Qt::IviMedia", extra=["COMPONENTS", "IviMedia"]), LibraryMapping("knx", "Qt6", "Qt::Knx", extra=["COMPONENTS", "Knx"]), - LibraryMapping("kmsconvenience", "Qt6", "Qt::KmsSupportPrivate", extra=["COMPONENTS", "KmsSupportPrivate"]), - LibraryMapping("kms_support", "Qt6", "Qt::KmsSupportPrivate", extra=["COMPONENTS", "KmsSupportPrivate"]), + LibraryMapping( + "kmsconvenience", "Qt6", "Qt::KmsSupportPrivate", extra=["COMPONENTS", "KmsSupportPrivate"] + ), + LibraryMapping( + "kms_support", "Qt6", "Qt::KmsSupportPrivate", extra=["COMPONENTS", "KmsSupportPrivate"] + ), LibraryMapping( "launcher-lib", "Qt6", "Qt::AppManLauncher", extra=["COMPONENTS", "AppManLauncher"] ), @@ -364,7 +380,9 @@ _qt_library_map = [ LibraryMapping("window-lib", "Qt6", "Qt::AppManWindow", extra=["COMPONENTS", "AppManWindow"]), LibraryMapping("winextras", "Qt6", "Qt::WinExtras", extra=["COMPONENTS", "WinExtras"]), LibraryMapping("x11extras", "Qt6", "Qt::X11Extras", extra=["COMPONENTS", "X11Extras"]), - LibraryMapping("xcb_qpa_lib", "Qt6", "Qt::XcbQpaPrivate", extra=["COMPONENTS", "XcbQpaPrivate"]), + LibraryMapping( + "xcb_qpa_lib", "Qt6", "Qt::XcbQpaPrivate", extra=["COMPONENTS", "XcbQpaPrivate"] + ), LibraryMapping( "xkbcommon_support", "Qt6", "Qt::XkbCommonSupport", extra=["COMPONENTS", "XkbCommonSupport"] ), @@ -402,7 +420,9 @@ _qt_library_map = [ _library_map = [ # 3rd party: LibraryMapping("atspi", "ATSPI2", "PkgConfig::ATSPI2"), - LibraryMapping("backtrace", "WrapBacktrace", "WrapBacktrace::WrapBacktrace", emit_if="config.unix"), + LibraryMapping( + "backtrace", "WrapBacktrace", "WrapBacktrace::WrapBacktrace", emit_if="config.unix" + ), LibraryMapping("bluez", "BlueZ", "PkgConfig::BlueZ"), LibraryMapping("brotli", "WrapBrotli", "WrapBrotli::WrapBrotliDec"), LibraryMapping("corewlan", None, None), @@ -496,7 +516,9 @@ _library_map = [ LibraryMapping("sqlite2", None, None), # No more sqlite2 support in Qt6! LibraryMapping("sqlite3", "SQLite3", "SQLite::SQLite3"), LibraryMapping("sqlite", "SQLite3", "SQLite::SQLite3"), - LibraryMapping("taglib", "WrapTagLib", "WrapTagLib::WrapTagLib", is_bundled_with_qt=True), # used in qtivi + LibraryMapping( + "taglib", "WrapTagLib", "WrapTagLib::WrapTagLib", is_bundled_with_qt=True + ), # used in qtivi LibraryMapping("tslib", "Tslib", "PkgConfig::Tslib"), LibraryMapping("udev", "Libudev", "PkgConfig::Libudev"), LibraryMapping("udev", "Libudev", "PkgConfig::Libudev"), # see also libudev! @@ -681,7 +703,7 @@ def find_library_info_for_target(targetName: str) -> typing.Optional[LibraryMapp # For a given qmake library (e.g. 'openssl_headers'), check whether this is a fake library used # for the /nolink annotation, and return the actual annotated qmake library ('openssl/nolink'). -def find_annotated_qmake_lib_name(lib : str) -> str: +def find_annotated_qmake_lib_name(lib: str) -> str: for entry in _library_map: if entry.no_link_so_name == lib: return entry.soName + "/nolink" diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fff3f4708c..d186d1e628 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3194,7 +3194,9 @@ def write_main_part( cm_fh.write(f"{spaces(indent)}if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)\n") cm_fh.write(f"{spaces(indent+1)}cmake_minimum_required(VERSION 3.16)\n") cm_fh.write(f"{spaces(indent+1)}project({name} LANGUAGES C CXX ASM)\n") - cm_fh.write(f"{spaces(indent+1)}find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)\n") + cm_fh.write( + f"{spaces(indent+1)}find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)\n" + ) cm_fh.write(f"{spaces(indent)}endif()\n\n") test_data = scope.expand("TESTDATA") @@ -3445,7 +3447,7 @@ def write_module(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str: extra.append("STATIC") if "internal_module" in scope.get("CONFIG"): is_public_module = False - cmake_target_name += "Private" # Assume all internal modules have the 'Private' suffix + cmake_target_name += "Private" # Assume all internal modules have the 'Private' suffix extra.append("INTERNAL_MODULE") if "no_module_headers" in scope.get("CONFIG"): extra.append("NO_MODULE_HEADERS") @@ -3865,9 +3867,9 @@ def write_example( property_win32, property_mac_bundle = get_win32_and_mac_bundle_properties(scope) if property_win32: - add_target += ' ' + "WIN32" + add_target += " " + "WIN32" if property_mac_bundle: - add_target += ' ' + "MACOSX_BUNDLE" + add_target += " " + "MACOSX_BUNDLE" write_all_source_file_lists(cm_fh, scope, add_target, indent=0) cm_fh.write(")\n") |