Browse Source

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.
Brad King 4 years ago
parent
commit
1dd0eae4fc
2 changed files with 2 additions and 2 deletions
  1. 1 1
      Tests/BuildDepends/Project/CMakeLists.txt
  2. 1 1
      Tests/CMakeLists.txt

+ 1 - 1
Tests/BuildDepends/Project/CMakeLists.txt

@@ -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}")

+ 1 - 1
Tests/CMakeLists.txt

@@ -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}")