1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

Tests: Fix xcode version detection for Xcode 13 on ARM

Running `xcode -version` on an ARM box prints content to stderr:

    objc[...]: Class ... is implemented in both...
    One of the two will be used. Which one is undefined.

Capture and parse only stdout.  Otherwise we might configure test
behavior for the wrong version of Xcode.
This commit is contained in:
Brad King
2021-06-18 13:56:02 -04:00
parent acd82e4690
commit 1dd0eae4fc
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ if(APPLE)
else()
execute_process(
COMMAND xcodebuild -version
OUTPUT_VARIABLE _version ERROR_VARIABLE _version
OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
)
if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")

View File

@@ -321,7 +321,7 @@ if(BUILD_TESTING)
else()
execute_process(
COMMAND xcodebuild -version
OUTPUT_VARIABLE _version ERROR_VARIABLE _version
OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
)
if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")