summaryrefslogtreecommitdiffstats
path: root/util/cmake/configurejson2cmake.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/cmake/configurejson2cmake.py')
-rwxr-xr-xutil/cmake/configurejson2cmake.py62
1 files changed, 19 insertions, 43 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index b5e148f63c..50a40f6112 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -1,31 +1,6 @@
#!/usr/bin/env python3
-#############################################################################
-##
-## Copyright (C) 2018 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the plugins of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2018 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import json_parser
import posixpath
@@ -611,7 +586,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 +621,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 +630,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 +640,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:
@@ -934,7 +909,7 @@ endif()""",
"condition": "__qt_ltcg_detected",
},
"msvc_mp": None,
- "simulator_and_device": {"condition": "UIKIT AND NOT QT_UIKIT_SDK"},
+ "simulator_and_device": {"condition": "UIKIT AND NOT QT_APPLE_SDK"},
"pkg-config": {"condition": "PKG_CONFIG_FOUND"},
"precompile_header": {"condition": "BUILD_WITH_PCH"},
"profile": None,
@@ -943,7 +918,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 +930,9 @@ endif()""",
},
],
},
- "reduce_exports": {"condition": "NOT MSVC",},
+ "reduce_exports": {
+ "condition": "NOT MSVC",
+ },
"release": None,
"release_tools": None,
"rpath": {
@@ -1407,11 +1388,6 @@ def parseCommandLinePrefixes(ctx, data, cm_fh):
cm_fh.write(f"qt_commandline_prefix({key} {data[key]})\n")
-def parseCommandLineAssignments(ctx, data, cm_fh):
- for key in data:
- cm_fh.write(f"qt_commandline_assignment({key} {data[key]})\n")
-
-
def processCommandLine(ctx, data, cm_fh):
print(" commandline:")
@@ -1433,8 +1409,7 @@ def processCommandLine(ctx, data, cm_fh):
print(" prefix:")
parseCommandLinePrefixes(ctx, commandLine["prefix"], cm_fh)
if "assignments" in commandLine:
- print(" assignments:")
- parseCommandLineAssignments(ctx, commandLine["assignments"], cm_fh)
+ print(" assignments are ignored")
def processInputs(ctx, data, cm_fh):
@@ -1524,6 +1499,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 +1547,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}.")