Tests: Fix XCTest when ENV{SDKROOT} is set

We use the host OS X version as the deployment target for this test.
This breaks if the SDKROOT environment variable specifies an
incompatible SDK version.  Explicitly specify `macosx` as the
SDK so that CMake will automatically select a version matching
the deployment target.
This commit is contained in:
Brad King 2016-02-19 09:28:27 -05:00
parent 29c266eb56
commit d8cba5368b
1 changed files with 1 additions and 1 deletions

View File

@ -1644,7 +1644,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5
AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1})
set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx)
ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
endif()