Xcode: Link matching zlib for iOS Simulator SDK

The XcodeRemoveExcessiveISystem test runs
`find_package(ZLIB)` which returns an SDK-relative
path to `zlib.tlb`. When the test switches the SDK
for building to something different than the SDK used
for configuration the linker rightfully complains about
the mismatch.

The fix is to configure and build with the same SDK.
This commit is contained in:
Gregor Jasny
2020-08-13 17:59:35 +02:00
parent 5748e76639
commit 862dbe1367

View File

@@ -310,10 +310,10 @@ endif()
if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
function(XcodeRemoveExcessiveISystemSDK SDK)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeRemoveExcessiveISystemSDK-${SDK}-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS")
set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS" "-DCMAKE_OSX_SYSROOT=${SDK}")
run_cmake(XcodeRemoveExcessiveISystem)
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(XcodeRemoveExcessiveISystemSDK-${SDK}-build ${CMAKE_COMMAND} --build . -- -sdk ${SDK})
run_cmake_command(XcodeRemoveExcessiveISystemSDK-${SDK}-build ${CMAKE_COMMAND} --build .)
endfunction()
XcodeRemoveExcessiveISystemSDK(iphoneos)