diff options
Diffstat (limited to 'util/cmake/condition_simplifier.py')
-rwxr-xr-x[-rw-r--r--] | util/cmake/condition_simplifier.py | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/util/cmake/condition_simplifier.py b/util/cmake/condition_simplifier.py index e6588a7cc7..a540ee0519 100644..100755 --- a/util/cmake/condition_simplifier.py +++ b/util/cmake/condition_simplifier.py @@ -1,31 +1,6 @@ #!/usr/bin/env python3 -############################################################################# -## -## Copyright (C) 2019 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) 2021 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import re @@ -72,8 +47,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,15 +75,15 @@ 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: # windowses = ('WIN32', 'WINRT') apples = ("MACOS", "UIKIT", "IOS", "TVOS", "WATCHOS") bsds = ("FREEBSD", "OPENBSD", "NETBSD") - androids = ("ANDROID", "ANDROID_EMBEDDED") + androids = ("ANDROID",) unixes = ( "APPLE", *apples, @@ -140,7 +115,6 @@ def _recursive_simplify(expr): expr = _simplify_flavors_in_condition("APPLE", apples, expr) expr = _simplify_flavors_in_condition("BSD", bsds, expr) expr = _simplify_flavors_in_condition("UNIX", unixes, expr) - expr = _simplify_flavors_in_condition("ANDROID", ("ANDROID_EMBEDDED",), expr) # Simplify families of OSes against other families: expr = _simplify_os_families(expr, ("WIN32", "WINRT"), unixes) |