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:
@@ -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}")
|
||||
|
@@ -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}")
|
||||
|
Reference in New Issue
Block a user