diff options
author | Brad King <brad.king@kitware.com> | 2020-11-06 12:58:25 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-06 12:58:55 (GMT) |
commit | e0438b05dee60ff19a1b6168a18cf89762707eb5 (patch) | |
tree | 5b9d0419658879467fa1ad6b0f9ea8838eef2be2 /Modules | |
parent | 2e86b0ec514c670c0b2c7cec761820ebf395b64e (diff) | |
parent | 4c6797e03e525e1f475547262149c4c6e8fedeb7 (diff) | |
download | CMake-e0438b05dee60ff19a1b6168a18cf89762707eb5.zip CMake-e0438b05dee60ff19a1b6168a18cf89762707eb5.tar.gz CMake-e0438b05dee60ff19a1b6168a18cf89762707eb5.tar.bz2 |
Merge topic 'apple-v4-tbd-file-arch-lookup'
4c6797e03e Apple: Update SDK architecture detection for tbd file version 4
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5470
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Darwin-Initialize.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 15e6123..213f71b 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -145,20 +145,26 @@ function(_apple_resolve_supported_archs_for_sdk_from_system_lib sdk_path ret ret # Newer SDKs ship text based dylib stub files which contain the architectures supported by the # library in text form. if(EXISTS "${system_lib_tbd_path}") - file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^archs: +\\[.+\\]") + file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^(archs|targets): +\\[.+\\]") if(NOT tbd_lines) set(${ret_failed} TRUE PARENT_SCOPE) return() endif() # The tbd architectures line looks like the following: - # archs: [ armv7, armv7s, arm64, arm64e ] + # archs: [ armv7, armv7s, arm64, arm64e ] + # or for version 4 TBD files: + # targets: [ armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ] list(GET tbd_lines 0 first_arch_line) string(REGEX REPLACE - "archs: +\\[ (.+) \\]" "\\1" arches_comma_separated "${first_arch_line}") + "(archs|targets): +\\[ (.+) \\]" "\\2" arches_comma_separated "${first_arch_line}") string(STRIP "${arches_comma_separated}" arches_comma_separated) string(REPLACE "," ";" arch_list "${arches_comma_separated}") string(REPLACE " " "" arch_list "${arch_list}") + + # Remove -platform suffix from target (version 4 only) + string(REGEX REPLACE "-[a-z-]+" "" arch_list "${arch_list}") + if(NOT arch_list) set(${ret_failed} TRUE PARENT_SCOPE) return() |