Tests: Specify destination for Xcode scheme

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

Fixes: #22704
This commit is contained in:
Gregor Jasny
2021-10-01 10:04:48 +02:00
committed by Brad King
parent 12b999e66a
commit 0e86fea0be

View File

@@ -91,7 +91,12 @@ function(XcodeSchemaGeneration)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
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()
if(NOT XCODE_VERSION VERSION_LESS 7)