浏览代码

Tests: Specify destination for Xcode scheme

The `Using the first of multiple matching destinations` warning
vanishes if we explicitly specify a destination.

Fixes: #22704
Gregor Jasny 4 年之前
父节点
当前提交
0e86fea0be
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Tests/RunCMake/XcodeProject/RunCMakeTest.cmake

+ 6 - 1
Tests/RunCMake/XcodeProject/RunCMakeTest.cmake

@@ -91,7 +91,12 @@ function(XcodeSchemaGeneration)
   file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
   file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
 
 
   run_cmake(XcodeSchemaGeneration)
   run_cmake(XcodeSchemaGeneration)
-  run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
+  if (XCODE_VERSION VERSION_GREATER_EQUAL 13)
+    set(maybe_destination -destination platform=macOS)
+  else()
+    set(maybe_destination "")
+  endif()
+  run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo ${maybe_destination} build)
 endfunction()
 endfunction()
 
 
 if(NOT XCODE_VERSION VERSION_LESS 7)
 if(NOT XCODE_VERSION VERSION_LESS 7)