From db745fdd2dbd57af54f7da637eef6c892824a6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 16 Mar 2020 13:37:10 +0100 Subject: cmake: Fix naming when referring to Apple macOS Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor --- util/cmake/condition_simplifier.py | 2 +- util/cmake/helper.py | 8 ++++---- util/cmake/pro2cmake.py | 2 +- util/cmake/tests/test_logic_mapping.py | 18 +++++++++--------- util/cmake/tests/test_scope_handling.py | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'util/cmake') diff --git a/util/cmake/condition_simplifier.py b/util/cmake/condition_simplifier.py index d02e70e489..13686df1eb 100644 --- a/util/cmake/condition_simplifier.py +++ b/util/cmake/condition_simplifier.py @@ -106,7 +106,7 @@ def _recursive_simplify(expr): # Simplify even further, based on domain knowledge: # windowses = ('WIN32', 'WINRT') - apples = ("APPLE_OSX", "APPLE_UIKIT", "APPLE_IOS", "APPLE_TVOS", "APPLE_WATCHOS") + apples = ("APPLE_MACOS", "APPLE_UIKIT", "APPLE_IOS", "APPLE_TVOS", "APPLE_WATCHOS") bsds = ("FREEBSD", "OPENBSD", "NETBSD") androids = ("ANDROID", "ANDROID_EMBEDDED") unixes = ( diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 9f88e23f97..606aa337e9 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -668,7 +668,7 @@ platform_mapping = { "gcc": "GCC", "icc": "ICC", "intel_icc": "ICC", - "osx": "APPLE_OSX", + "osx": "APPLE_MACOS", "ios": "APPLE_IOS", "freebsd": "FREEBSD", "openbsd": "OPENBSD", @@ -676,9 +676,9 @@ platform_mapping = { "haiku": "HAIKU", "netbsd": "NETBSD", "mac": "APPLE", - "macx": "APPLE_OSX", - "macos": "APPLE_OSX", - "macx-icc": "(APPLE_OSX AND ICC)", + "macx": "APPLE_MACOS", + "macos": "APPLE_MACOS", + "macx-icc": "(APPLE_MACOS AND ICC)", } diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6010120e45..ac6008f7dc 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1444,7 +1444,7 @@ def map_condition(condition: str) -> str: condition = re.sub(r"^no-png$", r"NOT QT_FEATURE_png", condition) condition = re.sub(r"contains\(CONFIG, static\)", r"NOT QT_BUILD_SHARED_LIBS", condition) condition = re.sub(r"contains\(QT_CONFIG,\w*shared\)", r"QT_BUILD_SHARED_LIBS", condition) - condition = re.sub(r"CONFIG\(osx\)", r"APPLE_OSX", condition) + condition = re.sub(r"CONFIG\(osx\)", r"APPLE_MACOS", condition) def gcc_version_handler(match_obj: Match): operator = match_obj.group(1) diff --git a/util/cmake/tests/test_logic_mapping.py b/util/cmake/tests/test_logic_mapping.py index c18c3ddc65..96feb3e615 100755 --- a/util/cmake/tests/test_logic_mapping.py +++ b/util/cmake/tests/test_logic_mapping.py @@ -124,34 +124,34 @@ def test_simplify_win32_and_watchos(): def test_simplify_apple_and_appleosx(): - validate_simplify('APPLE AND APPLE_OSX', 'APPLE_OSX') + validate_simplify('APPLE AND APPLE_MACOS', 'APPLE_MACOS') def test_simplify_apple_or_appleosx(): - validate_simplify('APPLE OR APPLE_OSX', 'APPLE') + validate_simplify('APPLE OR APPLE_MACOS', 'APPLE') def test_simplify_apple_or_appleosx_level1(): - validate_simplify('foobar AND (APPLE OR APPLE_OSX )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR APPLE_MACOS )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level1_double(): - validate_simplify('foobar AND (APPLE OR APPLE_OSX )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR APPLE_MACOS )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level1_double_with_extra_spaces(): - validate_simplify('foobar AND (APPLE OR APPLE_OSX ) ' - 'AND ( APPLE_OSX OR APPLE )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR APPLE_MACOS ) ' + 'AND ( APPLE_MACOS OR APPLE )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level2(): validate_simplify('foobar AND ( ( APPLE OR APPLE_WATCHOS ) ' - 'OR APPLE_OSX ) AND ( APPLE_OSX OR APPLE ) ' + 'OR APPLE_MACOS ) AND ( APPLE_MACOS OR APPLE ) ' 'AND ( (WIN32 OR WINRT) OR UNIX) ', 'APPLE AND foobar') def test_simplify_not_apple_and_appleosx(): - validate_simplify('NOT APPLE AND APPLE_OSX', 'OFF') + validate_simplify('NOT APPLE AND APPLE_MACOS', 'OFF') def test_simplify_unix_and_bar_or_win32(): @@ -182,5 +182,5 @@ def test_simplify_complex_false(): def test_simplify_android_not_apple(): - validate_simplify('ANDROID AND NOT ANDROID_EMBEDDED AND NOT APPLE_OSX', + validate_simplify('ANDROID AND NOT ANDROID_EMBEDDED AND NOT APPLE_MACOS', 'ANDROID AND NOT ANDROID_EMBEDDED') diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 1db8b2a079..ecb0ae06cf 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -305,7 +305,7 @@ def test_qstandardpaths_scopes(): scope6 = _new_scope(parent_scope=scope5, condition='UNIX') # mac { # OBJECTIVE_SOURCES += io/qstandardpaths_mac.mm - scope7 = _new_scope(parent_scope=scope6, condition='APPLE_OSX', SOURCES='qsp_mac.mm') + scope7 = _new_scope(parent_scope=scope6, condition='APPLE_MACOS', SOURCES='qsp_mac.mm') # } else:android:!android-embedded { # SOURCES += io/qstandardpaths_android.cpp scope8 = _new_scope(parent_scope=scope6, condition='else') @@ -330,12 +330,12 @@ def test_qstandardpaths_scopes(): assert scope4.total_condition == 'WINRT' assert scope5.total_condition == 'UNIX' assert scope6.total_condition == 'UNIX' - assert scope7.total_condition == 'APPLE_OSX' - assert scope8.total_condition == 'UNIX AND NOT APPLE_OSX' + assert scope7.total_condition == 'APPLE_MACOS' + assert scope8.total_condition == 'UNIX AND NOT APPLE_MACOS' assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED' - assert scope10.total_condition == 'UNIX AND NOT APPLE_OSX AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope10.total_condition == 'UNIX AND NOT APPLE_MACOS AND (ANDROID_EMBEDDED OR NOT ANDROID)' assert scope11.total_condition == 'HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' - assert scope12.total_condition == 'UNIX AND NOT APPLE_OSX AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope12.total_condition == 'UNIX AND NOT APPLE_MACOS AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' def test_recursive_expansion(): scope = _new_scope(A='Foo',B='$$A/Bar') -- cgit v1.2.3