diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-03-16 13:36:47 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-03-16 17:57:56 +0100 |
commit | 77885f8402ad65e00e01c5e15777edcedf9741b2 (patch) | |
tree | 456874ac9ce27cfb1d4c6100056893620b308529 /util/cmake | |
parent | db745fdd2dbd57af54f7da637eef6c892824a6fb (diff) |
cmake: Remove APPLE prefix from platform names
None of the other platforms have it.
Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake')
-rw-r--r-- | util/cmake/condition_simplifier.py | 2 | ||||
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 4 | ||||
-rw-r--r-- | util/cmake/helper.py | 16 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 | ||||
-rwxr-xr-x | util/cmake/tests/test_logic_mapping.py | 24 | ||||
-rwxr-xr-x | util/cmake/tests/test_scope_handling.py | 10 |
6 files changed, 29 insertions, 29 deletions
diff --git a/util/cmake/condition_simplifier.py b/util/cmake/condition_simplifier.py index 13686df1eb..e6588a7cc7 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_MACOS", "APPLE_UIKIT", "APPLE_IOS", "APPLE_TVOS", "APPLE_WATCHOS") + apples = ("MACOS", "UIKIT", "IOS", "TVOS", "WATCHOS") bsds = ("FREEBSD", "OPENBSD", "NETBSD") androids = ("ANDROID", "ANDROID_EMBEDDED") unixes = ( diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index cabf1e41e0..64ab5b749c 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -807,9 +807,9 @@ def get_feature_mapping(): # special case to disable implicit feature on WIN32, until ANGLE is ported "opengl-dynamic": {"autoDetect": "OFF"}, "opengles2": { # special case to disable implicit feature on WIN32, until ANGLE is ported - "condition": "NOT WIN32 AND ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND )" + "condition": "NOT WIN32 AND ( NOT WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND )" }, - "simulator_and_device": {"condition": "APPLE_UIKIT AND NOT QT_UIKIT_SDK"}, + "simulator_and_device": {"condition": "UIKIT AND NOT QT_UIKIT_SDK"}, "pkg-config": None, "posix_fallocate": None, # Only needed for sqlite, which we do not want to build "posix-libiconv": { diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 606aa337e9..00adc940f1 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -657,9 +657,9 @@ platform_mapping = { "nacl": "NACL", "android": "ANDROID", "android-embedded": "ANDROID_EMBEDDED", - "uikit": "APPLE_UIKIT", - "tvos": "APPLE_TVOS", - "watchos": "APPLE_WATCHOS", + "uikit": "UIKIT", + "tvos": "TVOS", + "watchos": "WATCHOS", "winrt": "WINRT", "wasm": "WASM", "emscripten": "EMSCRIPTEN", @@ -668,17 +668,17 @@ platform_mapping = { "gcc": "GCC", "icc": "ICC", "intel_icc": "ICC", - "osx": "APPLE_MACOS", - "ios": "APPLE_IOS", + "osx": "MACOS", + "ios": "IOS", "freebsd": "FREEBSD", "openbsd": "OPENBSD", "netbsd": "NETBSD", "haiku": "HAIKU", "netbsd": "NETBSD", "mac": "APPLE", - "macx": "APPLE_MACOS", - "macos": "APPLE_MACOS", - "macx-icc": "(APPLE_MACOS AND ICC)", + "macx": "MACOS", + "macos": "MACOS", + "macx-icc": "(MACOS AND ICC)", } diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ac6008f7dc..a50c7fe2bd 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_MACOS", condition) + condition = re.sub(r"CONFIG\(osx\)", r"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 96feb3e615..6e4fd20590 100755 --- a/util/cmake/tests/test_logic_mapping.py +++ b/util/cmake/tests/test_logic_mapping.py @@ -116,42 +116,42 @@ def test_simplify_unix_and_win32_or_foobar_or_barfoo(): def test_simplify_watchos_and_win32(): - validate_simplify('APPLE_WATCHOS AND WIN32', 'OFF') + validate_simplify('WATCHOS AND WIN32', 'OFF') def test_simplify_win32_and_watchos(): - validate_simplify('WIN32 AND APPLE_WATCHOS', 'OFF') + validate_simplify('WIN32 AND WATCHOS', 'OFF') def test_simplify_apple_and_appleosx(): - validate_simplify('APPLE AND APPLE_MACOS', 'APPLE_MACOS') + validate_simplify('APPLE AND MACOS', 'MACOS') def test_simplify_apple_or_appleosx(): - validate_simplify('APPLE OR APPLE_MACOS', 'APPLE') + validate_simplify('APPLE OR MACOS', 'APPLE') def test_simplify_apple_or_appleosx_level1(): - validate_simplify('foobar AND (APPLE OR APPLE_MACOS )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR MACOS )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level1_double(): - validate_simplify('foobar AND (APPLE OR APPLE_MACOS )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR MACOS )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level1_double_with_extra_spaces(): - validate_simplify('foobar AND (APPLE OR APPLE_MACOS ) ' - 'AND ( APPLE_MACOS OR APPLE )', 'APPLE AND foobar') + validate_simplify('foobar AND (APPLE OR MACOS ) ' + 'AND ( MACOS OR APPLE )', 'APPLE AND foobar') def test_simplify_apple_or_appleosx_level2(): - validate_simplify('foobar AND ( ( APPLE OR APPLE_WATCHOS ) ' - 'OR APPLE_MACOS ) AND ( APPLE_MACOS OR APPLE ) ' + validate_simplify('foobar AND ( ( APPLE OR WATCHOS ) ' + 'OR MACOS ) AND ( 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_MACOS', 'OFF') + validate_simplify('NOT APPLE AND 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_MACOS', + validate_simplify('ANDROID AND NOT ANDROID_EMBEDDED AND NOT 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 ecb0ae06cf..51e569fb09 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_MACOS', SOURCES='qsp_mac.mm') + scope7 = _new_scope(parent_scope=scope6, condition='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_MACOS' - assert scope8.total_condition == 'UNIX AND NOT APPLE_MACOS' + assert scope7.total_condition == 'MACOS' + assert scope8.total_condition == 'UNIX AND NOT MACOS' assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED' - assert scope10.total_condition == 'UNIX AND NOT APPLE_MACOS AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope10.total_condition == 'UNIX AND NOT 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_MACOS AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope12.total_condition == 'UNIX AND NOT MACOS AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' def test_recursive_expansion(): scope = _new_scope(A='Foo',B='$$A/Bar') |